Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2382 Представления

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

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить

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>

Автор

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)"

Автор

Please see my updated question

Related Posts Ответы Просмотры Активность
1
июл. 25
2445
2
июл. 25
7902
2
июл. 25
4310
2
июл. 25
4059
2
июн. 25
2659