[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
This commit is contained in:
Xavier BOL (xbo)
2022-04-08 17:13:27 +02:00
parent 731de19c27
commit c9b8b5b0eb
@@ -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