summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_list_editable.js
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-11-06 11:38:28 +0100
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-11-06 11:38:28 +0100
commitfd2bb078fb297c59b0359816e5cff5a33dbfc1a7 (patch)
treed8d6c1266302a842b79a5c7deceefdb592870367 /addons/web/static/src/js/view_list_editable.js
parent90484f785867fa3f3b1030a221d8e20d1d5f6549 (diff)
Fixed problem with editable list
bzr revid: nicolas.vanhoren@openerp.com-20121106103828-uw6xv1ed7wueii71
Diffstat (limited to 'addons/web/static/src/js/view_list_editable.js')
-rw-r--r--addons/web/static/src/js/view_list_editable.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index 021e5549c18..85465e1c54e 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -12,6 +12,8 @@ openerp.web.list_editable = function (instance) {
var self = this;
this._super.apply(this, arguments);
+ this.saving_mutex = new $.Mutex();
+
this._force_editability = null;
this._context_editable = false;
this.editor = this.make_editor();
@@ -162,10 +164,13 @@ openerp.web.list_editable = function (instance) {
* @returns {$.Deferred}
*/
ensure_saved: function () {
- if (!this.editor.is_editing()) {
- return $.when();
- }
- return this.save_edition();
+ var self = this;
+ return this.saving_mutex.exec(function() {
+ if (!self.editor.is_editing()) {
+ return $.when();
+ }
+ return self.save_edition();
+ });
},
/**
* Set up the edition of a record of the list view "inline"