[fix] problem in editable lists: could not edit an existing row
bzr revid: nicolas.vanhoren@openerp.com-20120419155514-j8bslmn6z7z1dh8h
This commit is contained in:
@@ -52,7 +52,6 @@ instance.web.FormView = instance.web.View.extend({
|
||||
this.mutating_mutex = new $.Mutex();
|
||||
this.on_change_mutex = new $.Mutex();
|
||||
this.reload_mutex = new $.Mutex();
|
||||
this.mode = null;
|
||||
this.rendering_engine = new instance.web.form.FormRenderingEngineReadonly(this);
|
||||
this.qweb = null; // A QWeb instance will be created if the view is a QWeb template
|
||||
},
|
||||
@@ -499,9 +498,8 @@ instance.web.FormView = instance.web.View.extend({
|
||||
}
|
||||
},
|
||||
switch_mode: function() {
|
||||
var mode = this.get("mode");
|
||||
var self = this;
|
||||
if(mode=="view") {
|
||||
if(this.get("mode") == "view") {
|
||||
self.$buttons.find('.oe_form_buttons_edit').hide();
|
||||
self.$buttons.find('.oe_form_buttons_view').show();
|
||||
_.each(this.fields,function(field){
|
||||
@@ -514,7 +512,6 @@ instance.web.FormView = instance.web.View.extend({
|
||||
field.set({"force_readonly": false});
|
||||
});
|
||||
}
|
||||
self.mode = mode;
|
||||
},
|
||||
on_button_save: function() {
|
||||
var self = this;
|
||||
|
||||
@@ -372,6 +372,7 @@ openerp.web.list_editable = function (instance) {
|
||||
init: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.rendering_engine = new instance.web.ListEditableRenderingEngine(this);
|
||||
this.options.initial_mode = "edit";
|
||||
},
|
||||
renderElement: function() {}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user