Skip to content
Snippets Groups Projects
Commit 191f9d05 authored by Martin Geubelle's avatar Martin Geubelle
Browse files

[FIX] web: reuse the same BasicModel instance

Before this revision, only the FormView allowed to reuse the same datapoint.
This was only used when opening a FormViewDialog when opening the form view
of record in a one2many field.

However, this could be useful in other places for other views. In Studio for
example, we need to instantiate a x2m view without the parent view ; we thus
need to be able to reuse the same model for all basic views.
parent c13c9e0b
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,10 @@ var BasicView = AbstractView.extend({
this.loadParams.context = params.context || {};
this.loadParams.limit = parseInt(viewInfo.arch.attrs.limit, 10) || params.limit;
this.loadParams.viewType = this.viewType;
this.loadParams.parentID = params.parentID;
this.recordID = params.recordID;
this.model = params.model;
},
//--------------------------------------------------------------------------
......
......@@ -27,7 +27,6 @@ var FormView = BasicView.extend({
var mode = params.mode || (params.currentId ? 'readonly' : 'edit');
this.loadParams.type = 'record';
this.loadParams.parentID = params.parentID;
this.controllerParams.disableAutofocus = params.disable_autofocus;
this.controllerParams.hasSidebar = params.sidebar;
......@@ -41,7 +40,6 @@ var FormView = BasicView.extend({
this.controllerParams.mode = mode;
this.rendererParams.mode = mode;
this.model = params.model;
},
//--------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment