[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#41977 X-original-commit: 5b7b12c9907d7da03e08df4f5bac2198c3dc9cba Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user