SHARE
TWEET

Untitled

a guest Apr 26th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <odoo>
  2.     <data>
  3.         <!-- Wrap the default in if/else to display custom content based on a custom variable. $0 will contain the original. -->
  4.         <template id="external_layout_standard_custom" inherit_id="web.external_layout_standard">
  5.             <xpath expr="//img[@t-if='company.logo']" position="replace">
  6.                 <t t-if="custom_header">
  7.                     <h2>CUSTOM LOGO HERE</h2>
  8.                 </t>
  9.                 <t t-else="1">$0</t>
  10.             </xpath>
  11.         </template>
  12.  
  13.         <!-- Just set the custom variable in the report you need before external_layout is called -->
  14.         <template id="report_saleorder_custom" inherit_id="sale.report_saleorder">
  15.             <xpath expr="//t[@t-call='web.html_container']" position="before">
  16.                 <t t-set="custom_header" t-value="True"/>
  17.             </xpath>
  18.         </template>
  19.  
  20.         <!-- That's it! -->
  21.  
  22.         <!-- Should work the same for new reports too -->
  23.         <template id="report_saleorder_commercial">
  24.             <t t-set="custom_header" t-value="False"/>
  25.             <t t-call="web.html_container">
  26.                 <t t-set="is_commercial" t-value="True"/>
  27.                 <t t-foreach="docs" t-as="doc">
  28.                     <t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>
  29.                 </t>
  30.             </t>
  31.         </template>
  32.         <report
  33.             id="action_report_commercial_invoice"
  34.             string="Commercial Invoice"
  35.             model="sale.order"
  36.             report_type="qweb-pdf"
  37.             file="beyondled.report_saleorder_commercial"
  38.             name="beyondled.report_saleorder_commercial"
  39.             print_report_name="'Commercial Invoice - %s' % (object.name)"
  40.         />
  41.     </data>
  42. </odoo>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top