[ADD] editable flag on list views for fp

bzr revid: xmo@openerp.com-20120808104311-ajrne9fb9emtaoe6
This commit is contained in:
Xavier Morel 2012-08-08 12:43:11 +02:00
parent 5c225be25e
commit 67518796c6
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,7 @@ openerp.web.list_editable = function (instance) {
// tree/@editable takes priority on everything else if present.
var result = this._super(data, grouped);
if (this.editable()) {
this.$element.addClass('oe_list_editable');
// FIXME: any hook available to ensure this is only done once?
this.$buttons
.off('click', '.oe_list_save')
@ -123,6 +124,8 @@ openerp.web.list_editable = function (instance) {
.then(this.proxy('setup_events'));
return $.when(result, editor_ready);
} else {
this.$element.removeClass('oe_list_editable');
}
return result;