From 191f9d05984a02bda5717ccd9256d44e130cfd35 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Wed, 8 Nov 2017 15:55:29 +0100 Subject: [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. --- addons/web/static/src/js/views/basic/basic_view.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src/js/views/basic') diff --git a/addons/web/static/src/js/views/basic/basic_view.js b/addons/web/static/src/js/views/basic/basic_view.js index bdc250011f0..8a91e2b90c7 100644 --- a/addons/web/static/src/js/views/basic/basic_view.js +++ b/addons/web/static/src/js/views/basic/basic_view.js @@ -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; }, //-------------------------------------------------------------------------- -- cgit v1.2.3