From c9b8b5b0ebd009efdd03dacaf79175593358a2b8 Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Tue, 5 Apr 2022 14:06:48 +0000 Subject: [PATCH] [FIX] project: parse the context given by the backend Before this commit, the context retrieves when the user clicks on a Profitability section is not parse, and since this context is a string containing the JS object with the context added, the context is not correctly added with the existing context. This commit parses the added context to correctly append it with the initial one. task-2814466 Part-of: odoo/odoo#88219 --- .../project/static/src/js/right_panel/project_right_panel.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/project/static/src/js/right_panel/project_right_panel.js b/addons/project/static/src/js/right_panel/project_right_panel.js index b16c0661bc2..da6715789cb 100644 --- a/addons/project/static/src/js/right_panel/project_right_panel.js +++ b/addons/project/static/src/js/right_panel/project_right_panel.js @@ -82,10 +82,7 @@ export default class ProjectRightPanel extends LegacyComponent { if (dataset.resId) { args.push(Number(dataset.resId)); } - let context = {}; - if (dataset.context) { - context = dataset.context; - } + const context = dataset.context ? JSON.parse(dataset.context) : {}; action = await this.rpc({ // Use the call_button method in order to have an action // with the correct view naming, i.e. list view is named