Advertisement
rht_odoo

[QW][3636752]adaptive_header_footer

Jun 5th, 2024 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.16 KB | None | 0 0
  1. <data>
  2.     <!--
  3.    # Done by RHT on the 05/06/2024
  4.    # Reviewed by xxx on the xx/05/2024
  5.    # Review:https://pastebin.com/8WWvHa3W
  6.    # Task: https://www.odoo.com/odoo/project.task/project.task/3636752?cids=1
  7.    # Need: Need multiple Logo/header/footer for one company
  8.    -->
  9.     <xpath expr="//img[@t-att-src='image_data_uri(company.logo)']" position="replace">
  10.         <!-- if we are on a model, that is account.move -->
  11.         <t t-if="o and o._name == 'account.move' ">
  12.             <!-- if we want the facto layout -->
  13.             <img t-if="o.x_studio_invoice_type == 'facto'" t-att-src="image_data_uri(o.company_id.x_studio_logo_facto_1)" style="max-height: 45px;" alt="Logo"/>
  14.             <!-- if we want the adpl layout -->
  15.             <img t-if="o.x_studio_invoice_type == 'adpl'" t-att-src="image_data_uri(o.company_id.x_studio_logo_adpl)" style="max-height: 45px;" alt="Logo"/>
  16.             <!-- if we want to keep the standard layout -->
  17.             <img t-if="not o.x_studio_invoice_type" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/>
  18.         </t>
  19.         <t t-else="">
  20.             <img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/>
  21.          </t>
  22.     </xpath>
  23.      <xpath expr="//span[@t-field='company.company_details']" position="replace">
  24.           <!-- if we are on a model, that is account.move -->
  25.         <t t-if="o and o._name == 'account.move' ">
  26.             <!-- if we want the facto layout -->
  27.             <span t-if="o.x_studio_invoice_type == 'facto'" t-field="o.company_id.x_studio_header_facto"/>
  28.             <!-- if we want the adpl layout -->
  29.             <span t-if="o.x_studio_invoice_type == 'adpl'" t-field="o.company_id.x_studio_header_adpl"/>
  30.             <!-- if we want to keep the standard layout -->
  31.             <span t-if="not o.x_studio_invoice_type" t-field="company.company_details"/>
  32.         </t>
  33.         <t t-else="">
  34.             <span t-field="company.company_details">
  35.                <div class="bg-light border-1 rounded h-100 d-flex flex-column align-items-center justify-content-center p-4 w-100 opacity-75 text-muted text-center">
  36.                     <strong>Company details block</strong>
  37.                     <div>Contains the company details.</div>
  38.                 </div>
  39.             </span>
  40.          </t>
  41.          
  42.     </xpath>
  43.     <xpath expr="//div[@t-field='company.report_footer']" position="replace">
  44.         <!-- if we are on a model, that is account.move -->
  45.         <t t-if="o and o._name == 'account.move' ">
  46.             <!-- if we want the facto layout -->
  47.             <div t-if="o.x_studio_invoice_type == 'facto' " t-field="o.company_id.x_studio_footer_facto"/>
  48.             <!-- if we want the adpl layout -->
  49.             <div t-if="o.x_studio_invoice_type == 'adpl' " t-field="o.company_id.x_studio_footer_adpl"/>
  50.             <!-- if we want to keep the standard layout -->
  51.             <div t-if="not o.x_studio_invoice_type" t-field="company.report_footer"/>
  52.         </t>
  53.         <t t-else="">
  54.             <div t-field="company.report_footer">Company Report Footer</div>
  55.         </t>
  56.     </xpath>
  57. </data>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement