[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:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user