diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2018-03-14 14:36:57 +0100 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2018-03-15 15:11:08 +0100 |
| commit | 61216f116ac5c6e144c693b15408ad13db9f7ed4 (patch) | |
| tree | 056f6cc40cf30f880a3c7200c9a21d3ccc21bb5b /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | f31516566e9a73039cbd476e0ab98e52c0cbefbb (diff) | |
[FIX] web: add many records in m2m list
Have a model with a m2m (field A)
this m2m has also a m2m (and displayed as m2m tags in the view) (field AA)
Have a domain on field A, to trigger the search view selection
Click on add an item
Select everything in the modal, making sure that there is more than 40 records
Click on Select
Before this commit:
There was a traceback indicating the local data did not contain records >= 40
This was because the internal data repository was constrained by a limit
After this commit:
We adapt the limit of the local data repository and there is not traceback
OPW 1823400
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 949eb68cefc..e60e3f15a03 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1646,6 +1646,12 @@ var BasicModel = AbstractModel.extend({ // handle multiple add: command[2] may be a dict of values (1 // record added) or an array of dict of values var data = _.isArray(command.ids) ? command.ids : [command.ids]; + + // Ensure the local data repository (list) boundaries can handle incoming records (data) + if (data.length + list.res_ids.length > list.limit) { + list.limit = data.length + list.res_ids.length; + } + var list_records = {}; _.each(data, function (d) { rec = self._makeDataPoint({ |
