[FIX] portal: use company_id for portal report generation

The company is needed in the context to get the paper format for
instance because of `get_paperformat`

X-original-commit: a1526eb4e5b1eb7cada603d7fcee7bb77c64bbac
This commit is contained in:
wan
2021-06-22 14:20:54 +00:00
parent 43e1d21e0e
commit 16595e8af2
+3
View File
@@ -410,6 +410,9 @@ class CustomerPortal(Controller):
if not isinstance(report_sudo, type(request.env['ir.actions.report'])):
raise UserError(_("%s is not the reference of a report", report_ref))
if hasattr(model, 'company_id'):
report_sudo = report_sudo.with_company(model.company_id)
method_name = '_render_qweb_%s' % (report_type)
report = getattr(report_sudo, method_name)([model.id], data={'report_type': report_type})[0]
reporthttpheaders = [