From 2f842d17038ab2946408a9d1525b30be0a783f3f Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 12 Oct 2015 16:08:42 +0200 Subject: [PATCH] [FIX] web: assertion error when save after speed multi delete in one2many To reproduce use a form view with a one2many editable list and create a lot of lines. Then click a few times quickly on the delete. If the user click at least two times on delete of a same record, the dataset add the id in "to_delete" the virtual id because "to_create" doesn't contains the virtual id of the record deleted previously. E.g.: create a "Customer Payments" and select a "Customer" and "Payment Method" who generate a lot of "Credits" lines. --- addons/web/static/src/js/data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 2170cee46fd..74e161bd878 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -902,7 +902,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ unlink: function(ids, callback, error_callback) { var self = this; _.each(ids, function(id) { - if (! _.detect(self.to_create, function(x) { return x.id === id; })) { + if (! _.detect(self.to_create, function(x) { return x.id === id; }) && _.detect(self.cache, function(x) { return x.id === id; })) { self.to_delete.push({id: id}); } });