From d9b794480a5ab7f7d6a1e0d92601eb737175e212 Mon Sep 17 00:00:00 2001 From: "Djamel (otd)" Date: Fri, 28 May 2021 08:24:47 +0000 Subject: [FIX] web: add the context in the parameters of the rpc in the _renderBanner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Install Accounting - Connect with a user who has a default company (e.g: Company A) and allowed companies (e.g: “Company A” and “Company B”) - Choose in the company selector “Company B” - Make sure that the onboarding panel in the default company has not been closed - Go to accounting and close the onboarding panel - Refresh the page Problem: The onboarding panel is still open because in the `account/account_dashboard_onboarding` method we check the`account_dashboard_onboarding_state` field of the default company instead of the current company because "allowed_company_ids" is not in the context This problem is also present in all the other views where an onboarding panel is present Solution: Add the context in the parameters of the rpc in the _renderBanner opw-2477148 closes odoo/odoo#71384 X-original-commit: 902950541f8c361e03821314aab4bf4f304ac37d Signed-off-by: Yannick Tivisse (yti) Signed-off-by: Djamel Touati --- addons/web/static/src/js/views/abstract_controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js index 06baab7b55c..02813959c35 100644 --- a/addons/web/static/src/js/views/abstract_controller.js +++ b/addons/web/static/src/js/views/abstract_controller.js @@ -338,7 +338,10 @@ var AbstractController = mvc.Controller.extend(ActionMixin, { */ _renderBanner: async function () { if (this.bannerRoute !== undefined) { - const response = await this._rpc({route: this.bannerRoute}); + const response = await this._rpc({ + route: this.bannerRoute, + params: {context: session.user_context}, + }); if (!response.html) { this.$el.removeClass('o_has_banner'); return Promise.resolve(); -- cgit v1.2.3