How can i set an if condition for a specific user in my invoice and quotation reports? I'd like to use this code to change the footer section based on the current user. Thanks
Odoo 14.0-20210927
(Community Edition)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How can i set an if condition for a specific user in my invoice and quotation reports? I'd like to use this code to change the footer section based on the current user. Thanks
Odoo 14.0-20210927
(Community Edition)
Hi
You can try by inheriting the invoice and quotation report and adding the condition of user name
Try like this
<template id="report_invoice_inherited" inherit_id="account.report_invoice">
<t t-foreach="docs" t-as="o">
<t t-if="user.partner_id == 'User name'">
add the change that you needed
</t>
</t>
</template>
Regards
Thank you for the answer. I've tried it with the following code but unfortunately it doesn't work.
<li t-if="company.name"><span t-field="company.name"/></li>
<li t-if="company.street"><span t-field="company.street"/></li>
<li t-if="company.street2"><span t-field="company.street2"/></li>
<li><span t-if="company.zip" t-field="company.zip"/> <span t-if="company.city" t-field="company.city"/></li>
<li t-if="company.country_id"><span t-field="company.country_id.name"/></li>
<li t-if="company.phone"><span t-field="company.phone"/></li>
<li t-if="company.email"><span t-field="company.email"/></li>
<li t-if="company.website"><span t-field="company.website"/></li>
<li t-if="user.partner_id == 'Admin'">Test</li>
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
Registrieren
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.