diff options
| author | Christophe Matthieu <chm@odoo.com> | 2016-02-25 14:02:20 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2016-03-14 10:14:16 +0100 |
| commit | feeac2a4f1cd777770dd2b42534904ac71f23e46 (patch) | |
| tree | 60a116265f5e51f3ec6790001ade5a5d6b3f440a /addons/web/static/src/js/framework | |
| parent | bbbf3db581b5cf883e10fa9cf9e2b1727f725669 (diff) | |
[FIX] web: various small issues in form view onchange/one2many
- Issue: Edit sale.order form view, add new line, change product who have
taxes and click quickly on save (with slow network) => error message.
Because some deferreds are lost.
- reduce number of reads and onchange for x2m widgets
- remove before_save method and use commit_value (the issue was that if the
before_save and the change trigger an onchange, the onchange deferred is not
checked before saving the content.
Diffstat (limited to 'addons/web/static/src/js/framework')
| -rw-r--r-- | addons/web/static/src/js/framework/data.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/addons/web/static/src/js/framework/data.js b/addons/web/static/src/js/framework/data.js index e92bbd98c53..1e437ea2e05 100644 --- a/addons/web/static/src/js/framework/data.js +++ b/addons/web/static/src/js/framework/data.js @@ -833,9 +833,10 @@ var BufferedDataSet = DataSetStatic.extend({ }); } this.delete_all = false; - _.each(_.clone(this.running_reads), function(el) { - el.reject(); - }); + this.cancel_read(); + }, + cancel_read: function () { + _.invoke(_.clone(this.running_reads), 'reject'); }, read_ids: function (ids, fields, options) { // read what is necessary from the server to have ids and the given @@ -897,11 +898,8 @@ var BufferedDataSet = DataSetStatic.extend({ }); var _super = this._super; this.mutex.exec(function () { - _super.call(self, to_get, fields, options).then(function() { - def.resolve.apply(def, arguments); - }, function() { - def.reject.apply(def, arguments); - }); + if (def.state() !== "pending") return; + _super.call(self, to_get, fields, options).then(_.bind(def.resolve, def), _.bind(def.reject, def)); return def; }); return def.then(function(records) { |
