diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2015-08-28 09:45:06 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2015-11-10 12:36:06 +0100 |
| commit | 3e1d5a5cca105fdf1e2f6446fe48b3a76f3654cb (patch) | |
| tree | edae110f52dd94b36b0d6c7cc175aba9dfd8210c /addons/web/static/src/js/data.js | |
| parent | c333385eda842dbea92c72db6f967575b2c715ad (diff) | |
[IMP] web: remove needless o2m onchange
Partial backport of master (-> v9) commit 059230512.
for the issue when removing an invoice line from an account.invoice,
three onchange where triggered:
- ListView account.invoice.line unlink the line id from its dataset,
[[first onchange]]
-> the line id is removed from the dataset which trigger an onchange
after this is done (and the onchange is finished), the following
onchange happen:
-- remove each record of the Collection of the ListView
-> this remove the id of these record from the ListView List dataset
[[second onchange]]
-> this trigger an onchange albeit the dataset is not changed
(since it was already removed before the first onchange)
-> this trigger an onchange on the one2many_list of the ListView
which has the same dataset as the ListView
[[third onchange]]
-> so an onchange is called yet again.
this commit removes the second onchange in this case where we remove ids
already removed from the dataset.
closes #8273
fixes #7595
opw-644706
Diffstat (limited to 'addons/web/static/src/js/data.js')
| -rw-r--r-- | addons/web/static/src/js/data.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 74e161bd878..95cbf067cfb 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -1047,8 +1047,11 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ return this._super(id, signal); }, alter_ids: function(n_ids) { + var dirty = !_.isEqual(this.ids, n_ids); this._super(n_ids); - this.trigger("dataset_changed", n_ids); + if(dirty) { + this.trigger("dataset_changed", n_ids); + } }, }); instance.web.BufferedDataSet.virtual_id_regex = /^one2many_v_id_.*$/; |
