[IMP] web_m2x_options: Added limit for o2m field entries

Added the system parameter "web_m2x_options.field_limit_entries" to set the limit of entries that can be displayed.
This commit is contained in:
Carlos Roca
2020-11-09 12:00:09 +01:00
parent 5427b0e57f
commit a9c15b35ec
4 changed files with 23 additions and 1 deletions

View File

@@ -361,4 +361,16 @@ odoo.define('web_m2x_options.web_m2x_options', function (require) {
}
},
});
// Extending class to allow change the limit of o2m registry entries using the
// system parameter "web_m2x_options.field_limit_entries".
FormView.include({
_setSubViewLimit: function (attrs) {
this._super(attrs);
var limit = ir_options["web_m2x_options.field_limit_entries"];
if (!_.isUndefined(limit)) {
attrs.limit = parseInt(limit);
}
},
});
});