Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <odoo>
- <data>
- <!-- Wrap the default in if/else to display custom content based on a custom variable. $0 will contain the original. -->
- <template id="external_layout_standard_custom" inherit_id="web.external_layout_standard">
- <xpath expr="//img[@t-if='company.logo']" position="replace">
- <t t-if="custom_header">
- <h2>CUSTOM LOGO HERE</h2>
- </t>
- <t t-else="1">$0</t>
- </xpath>
- </template>
- <!-- Just set the custom variable in the report you need before external_layout is called -->
- <template id="report_saleorder_custom" inherit_id="sale.report_saleorder">
- <xpath expr="//t[@t-call='web.html_container']" position="before">
- <t t-set="custom_header" t-value="True"/>
- </xpath>
- </template>
- <!-- That's it! -->
- <!-- Should work the same for new reports too -->
- <template id="report_saleorder_commercial">
- <t t-set="custom_header" t-value="False"/>
- <t t-call="web.html_container">
- <t t-set="is_commercial" t-value="True"/>
- <t t-foreach="docs" t-as="doc">
- <t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
- </t>
- </t>
- </template>
- <report
- id="action_report_commercial_invoice"
- string="Commercial Invoice"
- model="sale.order"
- report_type="qweb-pdf"
- file="beyondled.report_saleorder_commercial"
- name="beyondled.report_saleorder_commercial"
- print_report_name="'Commercial Invoice - %s' % (object.name)"
- />
- </data>
- </odoo>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement