Browse Source

[ADD] partner_brand: Branding view

12.0
Maxime Chambreuil 5 years ago
committed by OCA-git-bot
parent
commit
e432811e5c
  1. 8
      partner_brand/__manifest__.py
  2. 78
      partner_brand/views/report_template.xml

8
partner_brand/__manifest__.py

@ -3,20 +3,18 @@
{ {
"name": "Partner Brand", "name": "Partner Brand",
"summary": "Manage your brands",
"summary": "Manage your brands and use them on your documents",
"version": "12.0.1.0.0", "version": "12.0.1.0.0",
"category": "Sales Management", "category": "Sales Management",
"website": "https://github.com/OCA/sale-workflow", "website": "https://github.com/OCA/sale-workflow",
"author": [
"Open Source Integrators, ",
"Odoo Community Association (OCA)",
],
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"license": "AGPL-3", "license": "AGPL-3",
"depends": [ "depends": [
"contacts", "contacts",
], ],
"data": [ "data": [
"views/res_partner_views.xml", "views/res_partner_views.xml",
"views/report_template.xml",
], ],
"installable": True, "installable": True,
"development_status": "Beta", "development_status": "Beta",

78
partner_brand/views/report_template.xml

@ -0,0 +1,78 @@
<odoo>
<!-- Copyright (C) 2019 Open Source Integrators
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<template id="external_layout_standard"
inherit_id="web.external_layout_standard">
<xpath expr="//img[@t-if='company.logo']" position="replace">
<t t-if="'brand_id' in o.fields_get()">
<img t-if="o.brand_id"
t-att-src="image_data_uri(o.brand_id.image)"
style="max_height: 45px;" alt="Logo"/>
<img t-elif="company.logo"
t-att-src="image_data_uri(company.logo)"
style="max_height: 45px;" alt="Logo"/>
</t>
<t t-else="else">
<img t-if="company.logo"
t-att-src="image_data_uri(company.logo)"
style="max_height: 45px;" alt="Logo"/>
</t>
</xpath>
<xpath expr="//div[@t-field='company.partner_id']" position="replace">
<t t-if="'brand_id' in o.fields_get()">
<div t-if="o.brand_id" t-field="o.brand_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
<div t-else="else" t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
</t>
<t t-else="else">
<div t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
</t>
</xpath>
<xpath expr="//ul[hasclass('list-inline')]" position="replace">
<t t-if="'brand_id' in o.fields_get()">
<ul t-if="o.brand_id" 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="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>
</template>
</odoo>
Loading…
Cancel
Save