Fixed problem with editable list
bzr revid: nicolas.vanhoren@openerp.com-20121106103828-uw6xv1ed7wueii71
This commit is contained in:
parent
90484f7858
commit
fd2bb078fb
|
@ -3739,7 +3739,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
||||||
}
|
}
|
||||||
// FIXME: why isn't there an API for this?
|
// FIXME: why isn't there an API for this?
|
||||||
if (this.editor.form.$el.hasClass('oe_form_dirty')) {
|
if (this.editor.form.$el.hasClass('oe_form_dirty')) {
|
||||||
this.save_edition();
|
this.ensure_saved();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.cancel_edition();
|
this.cancel_edition();
|
||||||
|
|
|
@ -12,6 +12,8 @@ openerp.web.list_editable = function (instance) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
|
this.saving_mutex = new $.Mutex();
|
||||||
|
|
||||||
this._force_editability = null;
|
this._force_editability = null;
|
||||||
this._context_editable = false;
|
this._context_editable = false;
|
||||||
this.editor = this.make_editor();
|
this.editor = this.make_editor();
|
||||||
|
@ -162,10 +164,13 @@ openerp.web.list_editable = function (instance) {
|
||||||
* @returns {$.Deferred}
|
* @returns {$.Deferred}
|
||||||
*/
|
*/
|
||||||
ensure_saved: function () {
|
ensure_saved: function () {
|
||||||
if (!this.editor.is_editing()) {
|
var self = this;
|
||||||
return $.when();
|
return this.saving_mutex.exec(function() {
|
||||||
}
|
if (!self.editor.is_editing()) {
|
||||||
return this.save_edition();
|
return $.when();
|
||||||
|
}
|
||||||
|
return self.save_edition();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Set up the edition of a record of the list view "inline"
|
* Set up the edition of a record of the list view "inline"
|
||||||
|
|
Loading…
Reference in New Issue