Skip to Content
Menu
This question has been flagged
1 Reply
1761 Views

I want to remove some fields from a custom sale report, but both the original and the custom report are printed.


< report id="report_so_ext" string="Print without prices" model="sale.order" report_type="qweb-pdf" name="aro_ext.custom_so_report" file="aro_ext.custom_so_report" menu="True"/>


< template id="custom_so_report_ext" inherit_id="sale.report_saleorder_document" primary="True">

< xpath expr="//th[@name='th_priceunit']" position="replace">< /xpath>

< xpath expr="//th[@name='th_subtotal']" position="replace">< /xpath>

< xpath expr="//td[@name='td_priceunit']" position="replace">< /xpath>

< xpath expr="//td[@name='td_subtotal']" position="replace">< /xpath>

< /template>


< template id="custom_so_report" inherit_id="sale.report_saleorder"> 

< t t-call="web.html_container"> 

< t t-foreach="docs" t-as="doc"> 

< t t-call="aro_ext.custom_so_report_ext" t-lang="doc.partner_id.lang"/> 

< /t> 

< /t>

< /template>


Thank you for any suggestions

Avatar
Discard
Best Answer

Hello Brend,

You need to inherit the report_saleorder_document report template and replace thead as well as tbody.
you can refer to the below code.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

Here is the code :

<template id="report_saleorder_document_inherit" inherit_id="sale.report_saleorder_document">
<xpath expr="//th[@name='th_priceunit']" position="replace"></xpath>
<xpath expr="//th[@name='th_subtotal']" position="replace"></xpath>
<xpath expr="//td[@name='td_priceunit']" position="replace"></xpath>
<xpath expr="//td[@name='td_subtotal']" position="replace"></xpath>
</template>

Author

Hi, many thanks for your help. I get 'NoneType' object has no attribute 'with_context'. Referring to: t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"

Author

Please see my updated question

Related Posts Replies Views Activity
1
Nov 24
1484
1
Nov 24
1192
2
Sep 24
1047
1
Aug 24
2454
3
Aug 24
2687