summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-07-09 10:06:04 +0200
committerXavier Morel <xmo@openerp.com>2012-07-09 10:06:04 +0200
commitcd59881b05bcfc6d27e2b97ad5edb617dd3fdbb7 (patch)
tree0919b9d33844bfa9b6428f6445ee804274b7edab /addons/web/static/src
parentee20d563570fcf3b3eabb90d82dd5f1c5164f1a9 (diff)
[FIX] Editor is not restartable, so don't restart it.
Instead, create a new one at each on_loaded. Editor is not restartable because the formview wedges itself if its on_loaded is called more than once bzr revid: xmo@openerp.com-20120709080604-er1l6bn5eespue59
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_list_editable.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index ab02ef49093..1285e48885f 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -78,10 +78,16 @@ openerp.web.list_editable = function (instance) {
},
on_loaded: function (data, grouped) {
var self = this;
+ if (this.editor) {
+ this.editor.destroy();
+ }
// tree/@editable takes priority on everything else if present.
this.options.editable = ! this.options.read_only && (data.arch.attrs.editable || this.options.editable);
var result = this._super(data, grouped);
if (this.options.editable) {
+ // Editor is not restartable due to formview not being
+ // restartable
+ this.editor = new instance.web.list.Editor(this);
var editor_ready = this.editor.prependTo(this.$element)
.then(this.proxy('setupEvents'));