You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

527 lines
24 KiB

<?xml version = "1.0" encoding="utf-8"?>
<openerp>
<data>
<!--Add list of functions in partner view-->
<record id="view_contact_by_function_form" model="ir.ui.view">
<field name="name">contact.functions.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="use_parent_address" position="replace">
<field name="use_parent_address"
class="oe_edit_only oe_inline"
on_change="onchange_address(use_parent_address, parent_id)"
attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"
string="Use Organisation Address"/>
</field>
<label for="use_parent_address" position="replace">
<label for="use_parent_address"
class="oe_edit_only"
attrs="{'invisible': [('parent_id','=', False),('use_parent_address','=',False)]}"
string="Use Organisation Address"/>
</label>
<!--Add ')' at the end of 'Is an Organism?'-->
<label for="is_company" position="replace">
<label for="is_company" string="Is an Organism"/>)
</label>
<!--Replace Street placeholder by No, Street, Apartment/Office-->
<field name="street" position="attributes">
<attribute name="placeholder">No, Street, Apartment/Office</attribute>
</field>
<field name="fax" position="attributes">
<attribute name="string">Fax</attribute>
</field>
<notebook position="inside">
<page string="Functions"
attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}"
autofocus="autofocus">
<separator string="Select Functions for this Organisation"/>
<field name="function_ids"/>
</page>
<page string="History (Functions)" attrs="{'invisible': ['|','|',('is_company','=',True),('contact_id','!=',False),('other_contact_history_ids','=',[])]}">
<separator string="History"/>
<field name="other_contact_history_ids" mode="kanban"
attrs="{'invisible': [('other_contact_history_ids','=',False)]}">
<kanban>
<field name="color"/>
<field name="name"/>
<field name="title"/>
<field name="email"/>
<field name="parent_id" string="Organism"/>
<field name="is_company"/>
<field name="function_id" string="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="fax"/>
<field name="state_id"/>
<field name="has_image"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override">
<a type="open">
<t t-if="record.has_image.raw_value === true">
<img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)"
class="oe_kanban_image"/>
</t>
<t t-if="record.has_image.raw_value === false">
<t t-if="record.is_company.raw_value === true">
<img t-att-src='_s + "/base/static/src/img/company_image.png"'
class="oe_kanban_image"/>
</t>
<t t-if="record.is_company.raw_value === false">
<img t-att-src='_s + "/base/static/src/img/avatar.png"'
class="oe_kanban_image"/>
</t>
</t>
</a>
<div class="oe_kanban_details">
<h4 class="oe_partner_heading">
<a type="open">
<field name="name"/>
</a>
</h4>
<div class="oe_kanban_partner_categories"/>
<div class="oe_kanban_partner_links"/>
<ul>
<li t-if="!record.parent_id.raw_value and record.function_id.raw_value">
<field name="function_id"/>
</li>
<li t-if="record.parent_id.raw_value and record.function_id.raw_value">
<field name="function_id"/>
,
<field name="parent_id"/>
</li>
<li t-if="record.city.raw_value and !record.country.raw_value">
<field name="city"/>
</li>
<li t-if="!record.city.raw_value and record.country.raw_value">
<field name="country"/>
</li>
<li t-if="record.city.raw_value and record.country.raw_value">
<field name="city"/>
,
<field name="country"/>
</li>
<li t-if="record.email.raw_value">
<a t-attf-href="mailto:#{record.email.raw_value}">
<field name="email"/>
</a>
</li>
</ul>
</div>
</div>
</t>
</templates>
</kanban>
<form string="Contact" version="7.0">
<sheet>
<field name="image" widget='image' class="oe_avatar oe_left"
options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" style="width: 70%%"/>
</h1>
</div>
<group>
<!-- inherited part -->
<field name="category_id" widget="many2many_tags"
placeholder="Tags..." style="width: 70%%" string="Tag"/>
<field name="parent_id"
placeholder="Organism"
domain="[('is_company','=',True)]"
string="Parent Organism"/>
<!-- inherited part end -->
<field name="function_id" placeholder="e.g. Sales Director"/>
<group colspan="4">
<field name="start_date" />
<field name="end_date"/>
<field name="naming"/>
</group>
<field name="email"/>
<field name="phone"/>
<field name="mobile"/>
</group>
<div>
<field name="use_parent_address"/>
<label for="use_parent_address" string="Use Organisation Address"/>
</div>
<group>
<label for="type"/>
<div name="div_type">
<field class="oe_inline" name="type"/>
</div>
<label for="street" string="Address"
attrs="{'invisible': [('use_parent_address','=', True)]}"/>
<div attrs="{'invisible': [('use_parent_address','=', True)]}"
name="div_address">
<field name="street" placeholder="Street..."/>
<field name="street2"/>
<div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/>
<field name="state_id" class="oe_no_button"
placeholder="State" style="width: 37%%"
options='{"no_open": True}' on_change="onchange_state(state_id)"/>
<field name="zip" placeholder="ZIP" style="width: 20%%"/>
</div>
<field name="country_id" placeholder="Country"
class="oe_no_button" options='{"no_open": True}'/>
</div>
</group>
<field name="supplier" invisible="True"/>
<group string="Bank Accounts">
<field name="bank_ids" nolabel="1">
<tree string="Bank Details">
<field name="state" invisible="1"/>
<field name="sequence" invisible="1"/>
<field name="acc_number"/>
<field name="bank_name"/>
<field name="owner_name"/>
</tree>
</field>
</group>
</sheet>
</form>
</field>
</page>
</notebook>
<!--Replace function by function_id defined by Organisation-->
<field name="function" position="replace"/>
</field>
</record>
<!--Add start_date, end_date, naming and account bank in partner view-->
<record id="view_position_info_form" model="ir.ui.view">
<field name="name">position.info.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base_contact.view_partner_form_inherit"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='other_contact_ids']/form//field[@name='category_id']"
position="attributes">
<attribute name="string">Tag</attribute>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/form//field[@name='function']"
position="after">
<group colspan="4">
<field name="start_date" />
<field name="end_date"/>
<field name="naming"/>
</group>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/form//field[@name='supplier']"
position="after">
<group string="Bank Accounts">
<field name="bank_ids" nolabel="1"/>
</group>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/form//field[@name='parent_id']"
position="replace">
<group colspan="4">
<field name="parent_id" placeholder="Organism"
domain="[('is_company','=',True)]"
on_change="onchange_partner_function(parent_id)"
string="Parent Organism"/>
</group>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/form//field[@name='function']"
position="replace">
<group colspan="4">
<field name="function_id" string="Function"/>
</group>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/form//label[@for='use_parent_address']"
position="replace">
<label for="use_parent_address"/>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/kanban//field[@name='function']"
position="replace">
<group colspan="4">
<field name="function_id" string="Function"/>
</group>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/kanban//field[@name='has_image']"
position="after">
<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' : '')"
style="position: relative">
<a t-if="! read_only_mode" type="delete"
style="position: absolute; right: 0; padding: 4px; diplay: inline-block">
X
</a>
<div class="oe_module_vignette">
<a type="open">
<t t-if="record.has_image.raw_value === true">
<img t-att-src="kanban_image('res.partner', 'image',
record.id.value, {'preview_image': 'image_small'})"
class="oe_avatar oe_kanban_avatar_smallbox"/>
</t>
<t t-if="record.image and record.image.raw_value !== false">
<img t-att-src="'data:image/png;base64,'+record.image.raw_value"
class="oe_avatar oe_kanban_avatar_smallbox"/>
</t>
<t t-if="record.has_image.raw_value === false
and (!record.image or record.image.raw_value === false)">
<t t-if="record.is_company.raw_value === true">
<img t-att-src='_s + "/base/static/src/img/company_image.png"'
class="oe_kanban_image oe_kanban_avatar_smallbox"/>
</t>
<t t-if="record.is_company.raw_value === false">
<img t-att-src='_s + "/base/static/src/img/avatar.png"'
class="oe_kanban_image oe_kanban_avatar_smallbox"/>
</t>
</t>
</a>
<div class="oe_module_desc">
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
<table class="oe_kanban_table">
<tr>
<td class="oe_kanban_title1" align="left" valign="middle">
<h4>
<a type="open">
<field name="name"/>
</a>
</h4>
<i>
<t t-if="record.parent_id.raw_value and !record.function_id.raw_value">
<field name="parent_id"/>
</t>
<t t-if="!record.parent_id.raw_value and record.function_id.raw_value">
<field name="function_id"/>
</t>
<t t-if="record.parent_id.raw_value and record.function_id.raw_value">
<field name="function_id"/>
,
<field name="parent_id"/>
</t>
</i>
<div>
<a t-if="record.email.raw_value" title="Mail"
t-att-href="'mailto:'+record.email.value">
<field name="email"/>
</a>
</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 t-if="record.fax.raw_value">
Fax: <field name="fax"/>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</t>
</templates>
</xpath>
have the same form for contact and other postions
<field name="parent_id" position="replace">
<field name="parent_id" placeholder="Parent Organisation"
domain="[('is_company','=',True)]"
attrs="{'invisible': [('is_company','=', False)]}"/>
</field>
<xpath expr="//field[@name='child_ids']/form//field[@name='supplier']"
position="after">
<group string="Bank Accounts">
<field name="bank_ids" nolabel="1"/>
</group>
</xpath>
<xpath expr="//field[@name='child_ids']/form//field[@name='function']"
position="after">
<group colspan="4">
<field name="start_date" />
<field name="end_date"/>
<field name="naming"/>
</group>
</xpath>
<xpath expr="//field[@name='child_ids']/form//field[@name='function']"
position="replace">
<group colspan="4">
<field name="parent_id"
placeholder="Organism"
domain="[('is_company','=',True)]"
string="Parent Organisation" />
<field name="function_id"
readonly="False"
options="{'create': false, 'create_edit': false}"
domain="[('id', 'in', parent.function_ids[0][2])]"
string="Function"/>
</group>
</xpath>
<xpath expr="//field[@name='child_ids']/form//label[@for='use_parent_address']"
position="replace">
<label for="use_parent_address"/>
</xpath>
<xpath expr="//field[@name='child_ids']/kanban//field[@name='function']"
position="replace">
<group colspan="4">
<field name="function_id" string="Function"/>
</group>
</xpath>
<xpath expr="//field[@name='other_contact_ids']/kanban//field[@name='has_image']"
position="after">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override">
<a type="open">
<t t-if="record.has_image.raw_value === true">
<img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)"
class="oe_kanban_image"/>
</t>
<t t-if="record.has_image.raw_value === false">
<t t-if="record.is_company.raw_value === true">
<img t-att-src='_s + "/base/static/src/img/company_image.png"'
class="oe_kanban_image"/>
</t>
<t t-if="record.is_company.raw_value === false">
<img t-att-src='_s + "/base/static/src/img/avatar.png"'
class="oe_kanban_image"/>
</t>
</t>
</a>
<div class="oe_kanban_details">
<h4 class="oe_partner_heading">
<a type="open">
<field name="name"/>
</a>
</h4>
<div class="oe_kanban_partner_categories"/>
<div class="oe_kanban_partner_links"/>
<ul>
<li t-if="record.parent_id.raw_value and !record.function_id.raw_value">
<field name="parent_id"/>
</li>
<li t-if="!record.parent_id.raw_value and record.function_id.raw_value">
<field name="function_id"/>
</li>
<li t-if="record.parent_id.raw_value and record.function_id.raw_value">
<field name="function_id"/>
,
<field name="parent_id"/>
</li>
<li t-if="record.city.raw_value and !record.country.raw_value">
<field name="city"/>
</li>
<li t-if="!record.city.raw_value and record.country.raw_value">
<field name="country"/>
</li>
<li t-if="record.city.raw_value and record.country.raw_value">
<field name="city"/>
,
<field name="country"/>
</li>
<li t-if="record.email.raw_value">
<a t-attf-href="mailto:#{record.email.raw_value}">
<field name="email"/>
</a>
</li>
</ul>
</div>
</div>
</t>
</templates>
</xpath>
</field>
</record>
<!-- Actions for Organisation -->
<record id="action_partner_customer_form" model="ir.actions.act_window">
<field name="name">Company</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[('is_company','=',1)]</field>
<field name="context" eval="{'default_is_company': True}"/>
<field name="filter" eval="True"/>
</record>
<!-- Actions for Contacts -->
<record id="action_partner_contact_form" model="ir.actions.act_window">
<field name="name">Contacts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[('is_company','=',0)]</field>
<field name="filter" eval="True"/>
</record>
<!--Add country,street fields in tree partner view-->
<record model="ir.ui.view" id="view_partner_tree_country_address">
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<field name="country_id" position="replace"/>
<field name="name" position="after">
<field name="country_id"/>
</field>
<field name="email" position="after">
<field name="street" string="Address"/>
</field>
</field>
</record>
<!-- Inherit Categories adding functions -->
<record id="view_partner_category_functions_form" model="ir.ui.view">
<field name="name">Partner Categories Functions</field>
<field name="model">res.partner.category</field>
<field name="inherit_id" ref="base.view_partner_category_form"/>
<field name="arch" type="xml">
<xpath expr="//form[@string='Partner Category']/group[1]"
position="after">
<notebook position="inside">
<page string="Functions">
<separator string="Add function"/>
<group col="2" colspan="4">
<field name="category_function_ids" nolabel="1">
<tree string="Functions">
<field name="sequence"/>
<field name="function_id"/>
</tree>
<form string="Function">
<field name="function_id"/>
<field name="sequence"/>
</form>
</field>
</group>
</page>
</notebook>
</xpath>
</field>
</record>
<!--Replace company by Organisation-->
<record id="view_partner_simple_form" model="ir.ui.view">
<field name="name">res.partner.simplified.form</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<label for="is_company" position="replace">
<label for="is_company" string="Is an Organism"/>
</label>
<field name="parent_id" position="replace">
<field name="parent_id"
placeholder="Organism"
domain="[('is_company', '=', True)]"
context="{'default_is_company': True, 'default_supplier': supplier}"
attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}"
on_change="onchange_address(use_parent_address, parent_id)"/>
</field>
</field>
</record>
</data>
</openerp>