This question has been flagged
3 Replies
2055 Views

I want to hide some elements from account.report_invoice_document template . I don't want those elements in the PDF report.
How can I achieve this?

Avatar
Discard
Best Answer

Hi,

Refer the blog for inheriting and modifying existing reports.

https://www.odoo.yenthevg.com/inheriting-and-modifying-qweb-reports/

https://www.cybrosys.com/blog/modifying-existing-qweb-reports-in-odoo13


Avatar
Discard
Author

Hi Kiran,
I tried inheriting and replacing. While replacing I'm getting error.

Best Answer

Hi,

You can inherit account report as follows:


<template id="report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//div[@class='page']/h2[1]" position="after">
<div class="col-4">
<img t-if="o.l10n_sa_qr_code_str"
style="display:block;margin:10% auto 0 auto;"
t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s'%('QR', o.l10n_sa_qr_code_str, 150, 150)"/>
</div>
</xpath>
</template>




For more reference, see this: https://www.youtube.com/watch?v=l2tvrpfOR1E

Thanks

Avatar
Discard
Author

Hi Niyas,
I tried inheriting and replacing. While replacing I'm getting error.

try to share the error in comment or question

Best Answer

Hi, I don't have the answer to your question but I'm trying to post a new subject on the forum but evreytime an error page appears, why ? 

Avatar
Discard