Advertisement
rht_odoo

[QW][3879961]Alternative header/footer

Jun 10th, 2024
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.53 KB | None | 0 0
  1. <data>
  2.         <!--
  3.  # Done by RHT on the 22/04/2024
  4.  # Reviewed by SEA on the xx/xx/2024
  5.  # Review:
  6.  # Task: https://www.odoo.com/web#id=3879961&cids=1&menu_id=4720&action=333&active_id=5686&model=project.task&view_type=form
  7.  # Need: Have a different logo, header and footer for all documents if needed
  8.  -->
  9.         <xpath expr="//img[@t-att-src='image_data_uri(company.logo)']" position="replace">
  10.           <!-- if we are on a model, that we have company logo and that we want to keep the standard layout -->
  11.           <img t-if="o and company.logo and o.x_studio_standard_layout" t-att-src="image_data_uri(company.logo)" class="float-start" alt="Logo"/>
  12.           <!-- if we are on a model and we want the alternative layout -->
  13.           <img t-elif="o" t-att-src="image_data_uri(o.company_id.x_studio_logo)" class="float-start" alt="Logo"/>
  14.           <!-- so that we can open the document layout configurator -->
  15.           <img t-else="" t-att-src="image_data_uri(company.logo)" class="float-start" alt="Logo"/>
  16.         </xpath>
  17.         <xpath expr="//ul[@class='list-unstyled']" position="inside">
  18.           <li t-if="company.is_company_details_empty">
  19.             <t t-esc="company.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
  20.           </li>
  21.           <li t-elif="o and o.x_studio_standard_layout">
  22.             <!-- if we are on a model, that we have company header and that we want to keep the standard layout -->
  23.             <t t-esc="company.company_details"/>
  24.           </li>
  25.           <li t-elif="o">
  26.             <!-- if we are on a model and we want the alternative layout -->
  27.             <t t-field="o.company_id.x_studio_header"/>
  28.           </li>
  29.           <li t-else="">
  30.             <!-- so that we can open the document layout configurator -->
  31.             <t t-field="company.company_details"/>
  32.           </li>
  33.         </xpath>
  34.         <xpath expr="//div[@t-field='company.report_footer']" position="replace">
  35.           <!-- if we are on a model, that we have company header and that we want to keep the standard layout -->
  36.           <div t-if="o and o.x_studio_standard_layout" t-field="company.report_footer"/>
  37.           <!-- if we are on a model and we want the alternative layout -->
  38.           <div t-elif="o" t-field="company.x_studio_footer"/>
  39.           <!-- so that we can open the document layout configurator -->
  40.           <div t-else="" t-field="company.report_footer"/>
  41.         </xpath>
  42.       </data>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement