summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2021-03-05 08:25:52 +0000
committerAaron Bohy <aab@odoo.com>2021-03-05 14:04:42 +0000
commit45ae3311fa3f244f9b54349686cb0da8c7fa6a9a (patch)
treeef1cb236afcce62662a5ad1586a042f5c5dcec0a /addons/web/static/src
parentc813655074b3b83bdf9345ef12399b0b96feaf71 (diff)
[FIX] web: can edit many2many_checkboxes with 40+ values
Before this commit, if the widget "many2many_checkboxes" was set on a field with more than 40 values in the comodel (i.e. more than 40 checkboxes displayed), (un)selecting a checkbox that wasn't in the first 40 checkboxes crashed. This was due to the default x2many limit of 40: we only created a datapoint for the first 40 values, whereas we could have up to 100 values to process (name_search server-side limit). Note that this limit of 40 had no other impact than limitating the number of records processed by the BasicModel, the maximum number of checkboxes displayed being ruled by the name_search server-side limit. This commit ensures that all values returned by the server (at most 100 when this message is written) are processed and can be edited as expected. opw~2439041 X-original-commit: be5e5bc49cb9744c26ca75dcee74caf11447f250
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/fields/relational_fields.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js
index 01d4332ee36..9efd76985cc 100644
--- a/addons/web/static/src/js/fields/relational_fields.js
+++ b/addons/web/static/src/js/fields/relational_fields.js
@@ -2707,6 +2707,9 @@ var FieldMany2ManyCheckBoxes = AbstractField.extend({
}),
specialData: "_fetchSpecialRelation",
supportedFieldTypes: ['many2many'],
+ // set an arbitrary high limit to ensure that all data returned by the server
+ // are processed by the BasicModel (otherwise it would be 40)
+ limit: 100000,
init: function () {
this._super.apply(this, arguments);
this.m2mValues = this.record.specialData[this.name];