diff options
| author | RomainLibert <rli@odoo.com> | 2019-09-13 10:00:34 +0000 |
|---|---|---|
| committer | RomainLibert <rli@odoo.com> | 2019-09-13 10:00:34 +0000 |
| commit | 4c9624db9d4656457f4100ee2e848f0f81d264a9 (patch) | |
| tree | ec7224b5ea896b86193f6068d3093c8168e2b638 /addons/web/static/src | |
| parent | f6d88a2e8dedec2362868fe72763284a065b0e61 (diff) | |
[FIX] web: add context to /report/download
This commit fixes the /report/download route in multicompany
Since the multi company revamp (a5b6f31cf28e5381e1c85f66730bcdb55998e643)
the multi company rules depend on the context.
However the route /report/download was not forwarding any context, this meant
that when trying to read some fields on a record in a company that is different
than the default one, it would crash with the multi company ir.rule
Forwarding the context from the session in the Javascript call is quite simple
however since (521f7d36c1ff929ea52e9ed6fd4170bd3b968b19) it also requires to change
the signature of the `report_download` method in order to pass the context to the final
method.
As there was already some code allowing the adding of some context in `report_routes`
this PR reuses this code by simply passing the context as a kwargs.
closes odoo/odoo#36839
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/chrome/action_manager_report.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web/static/src/js/chrome/action_manager_report.js b/addons/web/static/src/js/chrome/action_manager_report.js index 5c1c5cbeb8e..61dbdbbcc96 100644 --- a/addons/web/static/src/js/chrome/action_manager_report.js +++ b/addons/web/static/src/js/chrome/action_manager_report.js @@ -51,6 +51,7 @@ ActionManager.include({ url: '/report/download', data: { data: JSON.stringify([url, type]), + context: JSON.stringify(session.user_context), }, success: resolve, error: (error) => { |
