partner-contact/partner_affiliate/views/res_partner_view.xml

138 lines
8.0 KiB
XML
Raw Normal View History

2024-10-01 05:51:46 +00:00
<?xml version="1.0" encoding="utf-8" ?>
<flectra>
<!-- Show always parent_id plus add affiliates -->
<record id="view_partner_form_add_affiliate" model="ir.ui.view">
<field name="model">res.partner</field>
<field eval="1" name="priority" />
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath
expr="/form/sheet//div[hasclass('o_row')]/field[@name='parent_id']"
position="attributes"
>
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr='//page[@name="internal_notes"]' position="before">
<page string="Affiliates" invisible="not is_company">
<field
name="affiliate_ids"
context="{'default_parent_id': id, 'default_is_company': True, 'default_type':'other'}"
mode="kanban"
>
<kanban on_create="base.view_partner_form">
<field name="id" />
<field name="color" />
<field name="name" />
<field name="title" />
<field name="type" />
<field name="email" />
<field name="is_company" />
<field name="function" />
<field name="phone" />
<field name="street" />
<field name="street2" />
<field name="zip" />
<field name="city" />
<field name="country_id" />
<field name="mobile" />
<field name="state_id" />
<field name="image_128" />
<field name="lang" />
<!-- fields in form x2many view to diminish requests -->
<field name="comment" />
<field name="display_name" />
<templates>
<t t-name="kanban-box">
<t
t-set="color"
t-value="kanban_color(record.color.raw_value)"
/>
<div
t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'"
>
<div class="o_kanban_image">
<img
alt="Contact image"
t-if="record.image_128.raw_value"
t-att-src="kanban_image('res.partner', 'image_128', record.id.raw_value)"
/>
<t t-if="!record.image_128.raw_value">
<img
alt="Delivery"
t-if="record.type.raw_value === 'delivery'"
t-att-src='_s + "/base/static/img/truck.png"'
/>
<img
alt="Invoice"
t-if="record.type.raw_value === 'invoice'"
t-att-src='_s + "/base/static/img/money.png"'
/>
<t
t-if="record.type.raw_value !== 'invoice' &amp;&amp; record.type.raw_value !== 'delivery'"
>
<img
alt="Logo"
t-if="record.is_company.raw_value === true"
t-att-src='_s + "/base/static/img/company_image.png"'
/>
<img
alt="Avatar"
t-if="record.is_company.raw_value === false"
t-att-src='_s + "/base/static/img/avatar_grey.png"'
/>
</t>
</t>
</div>
<div class="oe_kanban_details">
<field name="name" />
<button
class="btn btn-link"
type="object"
name="open_affiliate_form"
title="Open full form"
>
<i
class="fa fa-caret-right fa-2x"
style="position:absolute;top:-4px;right:5px;transform:rotateY(0deg) rotate(-45deg);"
/>
</button>
<div t-if="record.function.raw_value"><field
name="function"
/></div>
<div t-if="record.email.raw_value"><field
name="email"
widget="email"
/></div>
<div
t-if="record.type.raw_value != 'contact'"
>
<div>
<field name="zip" />
<field name="city" />
</div>
<field
t-if="record.state_id.raw_value"
name="state_id"
/>
<field name="country_id" />
</div>
<div t-if="record.phone.raw_value">Phone: <t
t-esc="record.phone.value"
/></div>
<div
t-if="record.mobile.raw_value"
>Mobile: <t
t-esc="record.mobile.value"
/></div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</page>
</xpath>
</field>
</record>
</flectra>