From a6a8d71a0e51afd4ebe5fee2dbe8640d2503e9b2 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 18 Mar 2013 18:45:03 +0100 Subject: [PATCH] [FIX] calls to fields_view_get do not pass the correct context, fails in o2m lp bug: https://launchpad.net/bugs/1091204 fixed bzr revid: nicolas.vanhoren@openerp.com-20130318174503-7xp04ccghdbqfvrl --- addons/web/static/src/js/search.js | 1 + addons/web/static/src/js/views.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index d0dfa9b4bfd..d7331d2cda8 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -389,6 +389,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea model: this.dataset._model, view_id: this.view_id, view_type: 'search', + context: this.dataset.get_context(), }); $.when(load_view).then(function (r) { diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 7b2fc87aa97..befbc7fe793 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1282,6 +1282,7 @@ instance.web.View = instance.web.Widget.extend({ "view_id": this.view_id, "view_type": this.view_type, "toolbar": !!this.options.$sidebar, + "context": this.dataset.get_context(), }); } return view_loaded_def.then(function(r) { @@ -1496,7 +1497,7 @@ instance.web.fields_view_get = function(args) { if (typeof model === 'string') { model = new instance.web.Model(args.model, args.context); } - return args.model.call('fields_view_get', [args.view_id, args.view_type, model.context(), args.toolbar]).then(function(fvg) { + return args.model.call('fields_view_get', [args.view_id, args.view_type, args.context, args.toolbar]).then(function(fvg) { return postprocess(fvg); }); };