[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
committed by nguyenhk
parent 7fb6885241
commit e7e795ccdd
4 changed files with 23 additions and 0 deletions

View File

@@ -474,4 +474,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);
}
},
});
});