Advertisement
rht_odoo

[QW][3879961]Alternative header/footer - version 2

Jun 10th, 2024 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.59 KB | None | 0 0
  1. <data>
  2.     <!--
  3.    # Done by RHT on the 05/06/2024
  4.    # Reviewed by SEA on the 24/06/2024
  5.    # Review:https://pastebin.com/NnPLnjh9
  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 sale.order -->
  11.         <t t-if="o and o._name == 'sale.order' ">
  12.             <!-- if we want the alternative layout -->
  13.             <img t-if="not o.x_studio_standard_layout " t-att-src="image_data_uri(o.company_id.x_studio_logo)" class="float-start" alt="Logo"/>
  14.             <!-- if we want to keep the standard layout -->
  15.             <img t-if="o.x_studio_standard_layout" t-att-src="image_data_uri(company.logo)" class="float-start" alt="Logo"/>
  16.         </t>
  17.         <t t-else="">
  18.             <img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-start" alt="Logo"/>
  19.          </t>
  20.     </xpath>
  21.      <xpath expr="//t[@t-esc='company.company_details']" position="replace">
  22.           <!-- if we are on a model, that is sale.order -->
  23.         <t t-if="o and o._name == 'sale.order' ">
  24.             <!-- if we want the alternative layout -->
  25.             <t t-if="not o.x_studio_standard_layout" t-esc="o.company_id.x_studio_header"/>
  26.             <!-- if we want to keep the standard layout -->
  27.             <t t-if="o.x_studio_standard_layout" t-esc="company.company_details"/>
  28.         </t>
  29.         <t t-else="">
  30.             <span t-field="company.company_details">
  31.                <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">
  32.                     <strong>Company details block</strong>
  33.                     <div>Contains the company details.</div>
  34.                 </div>
  35.             </span>
  36.          </t>
  37.          
  38.     </xpath>
  39.     <xpath expr="//div[@t-field='company.report_footer']" position="replace">
  40.         <!-- if we are on a model, that is sale.order -->
  41.         <t t-if="o and o._name == 'sale.order' ">
  42.             <!-- if we want the alternative layout -->
  43.             <div t-if="not o.x_studio_standard_layout " t-field="o.company_id.x_studio_footer"/>
  44.             <!-- if we want to keep the standard layout -->
  45.             <div t-if="o.x_studio_standard_layout" t-field="company.report_footer"/>
  46.         </t>
  47.         <t t-else="">
  48.             <div t-field="company.report_footer">Company Report Footer</div>
  49.         </t>
  50.     </xpath>
  51. </data>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement