diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index aca2a7f0c2a..40a97e92f2e 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2026,6 +2026,12 @@ .openerp .oe-select-create-popup-view-form > .oe_formview > .oe_form_pager { display: none; } +.openerp .oe_form .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page { + display: none; +} +.openerp .oe_form .oe_form_field_many2many > .oe-listview .oe_list_pager_single_page { + display: none; +} .openerp .oe_form td.oe_form_group_cell_label { border-right: 1px solid #dddddd; padding: 2px 0px 2px 0px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 66398bc899d..d53d66363a2 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1674,6 +1674,16 @@ $colour4: #8a89ba display: none // }}} + // FormView.one2many {{{ + .oe_form .oe_form_field_one2many > .oe_view_manager + .oe_list_pager_single_page + display: none + // }}} + // FormView.many2many {{{ + .oe_form .oe_form_field_many2many > .oe-listview + .oe_list_pager_single_page + display: none + // }}} // FormView.classes for openerp views {{{ .oe_form td.oe_form_group_cell_label diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 8f14431ac17..7a51cbce3c5 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3283,6 +3283,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ }, start: function() { this._super.apply(this, arguments); + this.$element.addClass('oe_form_field_many2many'); var self = this; @@ -3291,7 +3292,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ this.dataset.on_unlink.add_last(function(ids) { self.dataset_changed(); }); - + this.is_setted.then(function() { self.load_view(); }); @@ -3304,7 +3305,7 @@ instance.web.form.FieldMany2Many = instance.web.form.AbstractField.extend({ }); }); }); - }) + }); }, set_value: function(value_) { value_ = value_ || []; diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index de73ec21884..a90dabe1b4c 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -364,6 +364,7 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi } var total = dataset.size(); + this.$pager.toggleClass('oe_list_pager_single_page', (total <= this.limit())); var spager = '-'; if (total) { var range_start = this.page * this.limit() + 1; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index c48fff4c1f5..5e3df49b89b 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -404,7 +404,7 @@ - +

@@ -642,8 +642,8 @@
- - or Import @@ -1204,7 +1204,7 @@ - + this.attr('t-if', 'views.length != 1');