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.
62 lines
2.8 KiB
62 lines
2.8 KiB
<openerp>
|
|
<data>
|
|
<record id="view_partner_simple_form_firstname" model="ir.ui.view">
|
|
<field name="name">res.partner.simplified.form.firstname</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.view_partner_simple_form"/>
|
|
<field name="arch" type="xml">
|
|
<field name="name" position="attributes">
|
|
<attribute name="attrs">{'readonly': [('is_company', '=', False)], 'required': [('is_company', '=', True)]}</attribute>
|
|
</field>
|
|
<xpath expr="//div[@class='oe_title']" position="after">
|
|
<group attrs="{'invisible': [('is_company', '=', True)]}">
|
|
<field name="lastname" attrs="{'required': [('is_company', '=', False)]}"/>
|
|
<field name="firstname" />
|
|
</group>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="view_partner_form_firstname" model="ir.ui.view">
|
|
<field name="name">res.partner.form.firstname</field>
|
|
<field name="model">res.partner</field>
|
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
|
<field name="arch" type="xml">
|
|
<field name="name" position="attributes">
|
|
<attribute name="attrs">{'readonly': [('is_company', '=', False)], 'required': [('is_company', '=', True)]}</attribute>
|
|
</field>
|
|
<field name="category_id" position="before">
|
|
<group attrs="{'invisible': [('is_company', '=', True)]}">
|
|
<field name="lastname" attrs="{'required': [('is_company', '=', False)]}"/>
|
|
<field name="firstname"/>
|
|
</group>
|
|
</field>
|
|
<!-- Add firstname and last name in inner contact form of child_ids -->
|
|
<xpath expr="//form[@string='Contact']/sheet//field[@name='category_id']" position="before">
|
|
<group>
|
|
<label for="lastname" class="oe_edit_only"/>
|
|
<field name="lastname" required="1" nolabel="1"/>
|
|
<label for="firstname" class="oe_edit_only"/>
|
|
<field name="firstname" nolabel="1"/>
|
|
</group>
|
|
</xpath>
|
|
<xpath expr="//form[@string='Contact']/sheet//field[@name='category_id']" position="attributes">
|
|
<attribute name="style"/>
|
|
</xpath>
|
|
<xpath expr="//form[@string='Contact']/sheet/div/label" position="replace">
|
|
<div class="oe_edit_only">
|
|
<field name="is_company" on_change="onchange_type(is_company)" invisible="1"/>
|
|
</div>
|
|
</xpath>
|
|
<xpath expr="//form[@string='Contact']/sheet/div/h1/field[@name='name']" position="attributes">
|
|
<div class="oe_edit_only">
|
|
<attribute name="attrs">{'readonly': [('is_company', '=', False)], 'required': [('is_company', '=', True)]}</attribute>
|
|
</div>
|
|
</xpath>
|
|
|
|
|
|
</field>
|
|
</record>
|
|
|
|
</data>
|
|
</openerp>
|