partner-contact/partner_contact_in_several_companies/views/res_partner.xml
2021-04-28 17:43:20 +02:00

305 lines
16 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<flectra>
<record id="view_res_partner_filter_contact" model="ir.ui.view">
<field name="name">res.partner.select.contact</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<filter name="type_company" position="after">
<separator />
<filter
string="All positions"
name="type_otherpositions"
context="{'search_show_all_positions': {'is_set': True, 'set_value': True}}"
help="All partner positions"
/>
</filter>
<xpath expr="/search/group[@name='group_by']" position="inside">
<filter
string="Person"
name="group_person"
context="{'group_by': 'contact_id'}"
/>
</xpath>
</field>
</record>
<record id="view_res_partner_tree_contact" model="ir.ui.view">
<field name="name">res.partner.tree.contact</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree" />
<field name="arch" type="xml">
<field name="parent_id" position="after">
<field name="contact_id" invisible="1" />
</field>
</field>
</record>
<record model="ir.ui.view" id="view_partner_form_inherit">
<field name="name">res.partner.form.contact</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="type">form</field>
<field name="arch" type="xml">
<field name="parent_id" position="after">
<field name="contact_id" invisible="1" />
</field>
<xpath
expr="//field[@name='child_ids']/form//field[@name='name']"
position="before"
>
<field name='contact_type' readonly='0' />
<field
name="contact_id"
string="Contact"
attrs="{'invisible': [('contact_type','!=','attached')], 'required': [('contact_type','=','attached')]}"
/>
</xpath>
<xpath
expr="//field[@name='child_ids']/form//field[@name='name']"
position="attributes"
>
<attribute
name="attrs"
>{'invisible': [('contact_type','=','attached')]}</attribute>
</xpath>
<field name="is_company" position="after">
<field name="contact_type" invisible="1" />
</field>
<page name='internal_notes' position="before">
<page
name="other_position"
string="Other Positions"
attrs="{'invisible': ['|',('is_company','=',True),('contact_id','!=',False)]}"
>
<field
name="other_contact_ids"
context="{'default_contact_id': active_id, 'default_name': name, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id}"
mode="kanban"
>
<kanban create="false">
<field name="color" />
<field name="name" />
<field name="title" />
<field name="email" />
<field name="parent_id" />
<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" />
<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'"
>
<a
t-if="!read_only_mode"
type="delete"
class="fa fa-times pull-right"
title="Delete Contact"
/>
<div class="o_kanban_image">
<img
alt="Contact Image"
t-if="record.image_128.raw_value"
t-att-src="'data:image/png;base64,' + record.image_128.raw_value"
/>
<t t-if="!record.image_128.raw_value">
<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>
</div>
<div class="oe_kanban_details">
<field name="name" />
<div t-if="record.function.raw_value">
<field name="function" />
at
<field name="parent_id" />
</div>
<div t-if="record.email.raw_value">
<field name="email" />
</div>
<div t-if="record.phone.raw_value">Phone:
<field name="phone" />
</div>
<div t-if="record.mobile.raw_value">Mobile:
<field name="mobile" />
</div>
</div>
</div>
</t>
</templates>
</kanban>
<form string="Contact">
<sheet>
<field
name="type"
required="1"
widget="radio"
options="{'horizontal': true}"
/>
<hr />
<group>
<group
attrs="{'invisible': [('type','=', 'contact')]}"
>
<label for="street" string="Address" />
<div>
<div
class="o_address_format"
name="div_address"
>
<field
name="street"
placeholder="Street..."
class="o_address_street"
/>
<field
name="street2"
placeholder="Street 2..."
class="o_address_street"
/>
<field
name="city"
placeholder="City"
class="o_address_city"
/>
<field
name="state_id"
class="o_address_state"
placeholder="State"
options='{"no_open": True}'
context="{'country_id': country_id, 'zip': zip}"
/>
<field
name="zip"
placeholder="ZIP"
class="o_address_zip"
/>
<field
name="country_id"
placeholder="Country"
class="o_address_country"
options='{"no_open": True, "no_create": True}'
/>
</div>
</div>
</group>
<group>
<field
name="name"
string="Contact Name"
attrs="{'required' : [('type', '=', 'contact')]}"
/>
<field
name="title"
placeholder="e.g. Mr."
attrs="{'invisible': [('type','&lt;&gt;', 'contact')]}"
/>
<field
name="function"
placeholder="e.g. Sales Director"
attrs="{'invisible': [('type','&lt;&gt;', 'contact')]}"
/>
<field name="email" />
<field name="phone" widget="phone" />
<field name="mobile" widget="phone" />
<field
name="comment"
placeholder="internal note..."
/>
</group>
</group>
<field name="lang" invisible="True" />
</sheet>
</form>
</field>
</page>
</page>
</field>
</record>
<record id="personal_contact_information" model="ir.ui.view">
<field name="name">Contacts in several partners: personal info</field>
<field name="model">res.partner</field>
<field
name="inherit_id"
ref="partner_contact_personal_information_page.personal_information"
/>
<field name="arch" type="xml">
<xpath
expr="//page[@name='personal_information_page']/group[@name='personal_information_group']"
position='attributes'
>
<attribute
name='attrs'
>{'invisible': [('contact_id','!=',False)]}</attribute>
</xpath>
<xpath
expr="//page[@name='personal_information_page']/group[@name='personal_information_group']"
position='after'
>
<p attrs="{'invisible': [('contact_id','=',False)]}">
To see personal information about this contact, please
go to to the this person form:
<field
name="contact_id"
class="oe_inline"
domain="[('contact_type','!=','attached')]"
context="{'show_address': 1}"
options="{'always_reload': True}"
/>
</p>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_res_partner_kanban_contact">
<field name="name">res.partner.kanban.contact</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.res_partner_kanban_view" />
<field name="arch" type="xml">
<field name="is_company" position="after">
<field name="other_contact_ids">
<tree>
<field name="parent_id" />
<field name="function" />
</tree>
</field>
</field>
<xpath
expr="//t[@t-name='kanban-box']//div[hasclass('oe_kanban_details')]/ul/li[3]"
position="after"
>
<t t-if="record.other_contact_ids.raw_value.length &gt; 0">
<li>+
<t t-esc="record.other_contact_ids.raw_value.length" />
<t
t-if="record.other_contact_ids.raw_value.length == 1"
>other position</t>
<t
t-if="record.other_contact_ids.raw_value.length &gt; 1"
>other positions</t>
</li>
</t>
</xpath>
</field>
</record>
</flectra>