Browse Source

[IMP] partner_brand: Split the template

12.0
Maxime Chambreuil 5 years ago
committed by OCA-git-bot
parent
commit
2a2fa78123
  1. 83
      partner_brand/views/report_template.xml

83
partner_brand/views/report_template.xml

@ -3,7 +3,7 @@
<!-- Copyright (C) 2019 Open Source Integrators <!-- Copyright (C) 2019 Open Source Integrators
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<template id="external_layout_standard"
<template id="external_layout_standard_logo"
inherit_id="web.external_layout_standard"> inherit_id="web.external_layout_standard">
<xpath expr="//img[@t-if='company.logo']" position="replace"> <xpath expr="//img[@t-if='company.logo']" position="replace">
@ -18,56 +18,63 @@
style="max-height: 45px;" alt="Logo"/> style="max-height: 45px;" alt="Logo"/>
</t> </t>
</xpath> </xpath>
</template>
<template id="external_layout_standard_address"
inherit_id="web.external_layout_standard">
<xpath expr="//div[@t-field='company.partner_id']" position="replace"> <xpath expr="//div[@t-field='company.partner_id']" position="replace">
<t t-if="'brand_id' in o.fields_get() and o.brand_id"> <t t-if="'brand_id' in o.fields_get() and o.brand_id">
<div t-field="o.brand_id.name"/>
<div t-field="o.brand_id" <div t-field="o.brand_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/>
</t> </t>
<t t-else=""> <t t-else="">
<div t-field="company.partner_id" <div t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/> t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
</t> </t>
</xpath> </xpath>
</template>
<template id="external_layout_standard_footer"
inherit_id="web.external_layout_standard">
<xpath expr="//ul[hasclass('list-inline')]" position="replace"> <xpath expr="//ul[hasclass('list-inline')]" position="replace">
<t t-if="'brand_id' in o.fields_get() and o.brand_id">
<ul class="list-inline mb4">
<li t-if="o.brand_id.phone" class="list-inline-item">
Phone:
<span t-field="o.brand_id.phone"/>
</li>
<li t-if="o.brand_id.email" class="list-inline-item">
Email:
<span t-field="o.brand_id.email"/>
</li>
<li t-if="o.brand_id.website" class="list-inline-item">
Web:
<span t-field="o.brand_id.website"/>
</li>
</ul>
</t>
<t t-else="">
<ul t-if="company" class="list-inline mb4">
<li t-if="company.phone"
class="list-inline-item">
Phone:
<span t-field="company.phone"/>
</li>
<li t-if="company.email"
class="list-inline-item">
Email:
<span t-field="company.email"/>
</li>
<li t-if="company.website"
class="list-inline-item">
Web:
<span t-field="company.website"/>
</li>
</ul>
</t>
<t t-if="'brand_id' in o.fields_get() and o.brand_id">
<ul class="list-inline mb4">
<li t-if="o.brand_id.phone" class="list-inline-item">
Phone:
<span t-field="o.brand_id.phone"/>
</li>
<li t-if="o.brand_id.email" class="list-inline-item">
Email:
<span t-field="o.brand_id.email"/>
</li>
<li t-if="o.brand_id.website" class="list-inline-item">
Web:
<span t-field="o.brand_id.website"/>
</li>
</ul>
</t>
<t t-else="">
<ul t-if="company" class="list-inline mb4">
<li t-if="company.phone"
class="list-inline-item">
Phone:
<span t-field="company.phone"/>
</li>
<li t-if="company.email"
class="list-inline-item">
Email:
<span t-field="company.email"/>
</li>
<li t-if="company.website"
class="list-inline-item">
Web:
<span t-field="company.website"/>
</li>
</ul>
</t>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>
Loading…
Cancel
Save