[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.
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user