Skip to content
Snippets Groups Projects
Commit 5b7b12c9 authored by Nans Lefebvre's avatar Nans Lefebvre
Browse files

[FIX] account: invoice report template for multi-company


Be in multi-company with companies C1, C2.
Let user U1 in company C1 create a vendor bill V.
Then U1 change to company C2.
Another user U2, in company C1, tries to print the vendor bill.
Traceback: Access error trying to access U1 to render the template

opw 2145738

closes odoo/odoo#41644

Signed-off-by: default avatarNans Lefebvre (len) <len@odoo.com>
parent 8c257a62
Branches
Tags
No related merge requests found
......@@ -218,7 +218,7 @@
<template id="report_invoice">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="lang" t-value="o.invoice_user_id.lang if o.type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
<t t-set="lang" t-value="o.invoice_user_id.sudo().lang if o.type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
<t t-call="account.report_invoice_document" t-lang="lang"/>
</t>
</t>
......@@ -227,7 +227,7 @@
<template id="report_invoice_with_payments">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="lang" t-value="o.invoice_user_id.lang if o.type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
<t t-set="lang" t-value="o.invoice_user_id.sudo().lang if o.type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
<t t-call="account.report_invoice_document_with_payments" t-lang="lang"/>
</t>
</t>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment