[FIX] Problem with SelectCreatePopup, the list view can sometimes be editable

lp bug: https://launchpad.net/bugs/1005812 fixed

bzr revid: nicolas.vanhoren@openerp.com-20120607152301-mu43z3n7q2fonsuk
This commit is contained in:
niv-openerp 2012-06-07 17:23:01 +02:00
parent eb7b8c8fcb
commit c7e32e7175
3 changed files with 7 additions and 4 deletions

View File

@ -3777,7 +3777,8 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend
self.view_list = new instance.web.form.SelectCreateListView(self,
self.dataset, false,
_.extend({'deletable': false,
'selectable': !self.options.disable_multiple_selection
'selectable': !self.options.disable_multiple_selection,
'read_only': true,
}, self.options.list_view_options || {}));
self.view_list.popup = self;
self.view_list.appendTo($(".oe-select-create-popup-view-list", self.$element)).pipe(function() {

View File

@ -21,6 +21,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
// whether the view rows can be reordered (via vertical drag & drop)
'reorderable': true,
'action_buttons': true,
// if true, the view can't be editable, ignoring the view's and the context's
// instructions
'read_only': false,
},
/**
* Core class for list-type displays.

View File

@ -54,8 +54,7 @@ openerp.web.list_editable = function (instance) {
// view' @editable is handled separately as we have not yet
// fetched and processed the view at this point.
this.options.editable = (
(force && "bottom")
|| this.defaults.editable);
! this.options.read_only && ((force && "bottom") || this.defaults.editable));
},
/**
* Replace do_search to handle editability process
@ -79,7 +78,7 @@ openerp.web.list_editable = function (instance) {
},
on_loaded: function (data, grouped) {
// tree/@editable takes priority on everything else if present.
this.options.editable = data.arch.attrs.editable || this.options.editable;
this.options.editable = ! this.options.read_only && (data.arch.attrs.editable || this.options.editable);
return this._super(data, grouped);
},
/**