Skip to content
Snippets Groups Projects
Commit 5a01eacaa6a2 authored by oury.balde's avatar oury.balde
Browse files

redner report handler: update context handling

- Replaced `env.services.user.context` with `user.context`.
- Added import for `user` from `@web/core/user`.
parent 142079b2f8fe
No related branches found
No related tags found
1 merge request!62migrate to odoo 18
......@@ -19,8 +19,8 @@
/* Add a report handler to download redner reports.
* Adapted from OCA's report_xlsx module:
* https://github.com/OCA/reporting-engine/blob/16.0/report_xlsx/static/src/js/report/action_manager_report.esm.js
* https://github.com/OCA/reporting-engine/blob/18.0/report_xlsx/static/src/js/report/action_manager_report.esm.js
*/
import {download} from "@web/core/network/download";
import {registry} from "@web/core/registry";
......@@ -23,7 +23,8 @@
*/
import {download} from "@web/core/network/download";
import {registry} from "@web/core/registry";
import {user} from "@web/core/user";
registry
.category("ir.actions.report handlers")
......@@ -43,9 +44,7 @@
url += `/${actionContext.active_ids.join(",")}`;
}
if (type === "redner") {
const context = encodeURIComponent(
JSON.stringify(env.services.user.context)
);
const context = encodeURIComponent(JSON.stringify(user.context));
url += `?context=${context}`;
}
}
......@@ -55,7 +54,7 @@
url: "/report/download",
data: {
data: JSON.stringify([url, action.report_type]),
context: JSON.stringify(env.services.user.context),
context: JSON.stringify(user.context),
},
});
} finally {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment