|
|
@ -12,23 +12,25 @@ |
|
|
|
'required': [('is_company', '=', True)] |
|
|
|
}</attribute> |
|
|
|
</xpath> |
|
|
|
|
|
|
|
<xpath expr="//h1//field[@name='name']/.." position="before"> |
|
|
|
<group attrs="{'invisible': [('is_company', '=', True)]}"> |
|
|
|
<field name="lastname" attrs= |
|
|
|
"{'required': [('firstname', '=', False), |
|
|
|
<field |
|
|
|
name="lastname" |
|
|
|
attrs="{'required': [('firstname', '=', False), |
|
|
|
('is_company', '=', False), |
|
|
|
('type', '=', 'contact')]}"/> |
|
|
|
<field name="firstname" attrs= |
|
|
|
"{'required': [('lastname', '=', False), |
|
|
|
('type', '=', 'contact')]}" |
|
|
|
/> |
|
|
|
<field |
|
|
|
name="firstname" |
|
|
|
attrs="{'required': [('lastname', '=', False), |
|
|
|
('is_company', '=', False), |
|
|
|
('type', '=', 'contact')]}"/> |
|
|
|
('type', '=', 'contact')]}" |
|
|
|
/> |
|
|
|
</group> |
|
|
|
</xpath> |
|
|
|
</data> |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
|
|
|
|
<record id="view_partner_form_firstname" model="ir.ui.view"> |
|
|
|
<field name="name">Add firstname and surnames</field> |
|
|
|
<field name="model">res.partner</field> |
|
|
@ -41,44 +43,53 @@ |
|
|
|
'required': [('is_company', '=', True)] |
|
|
|
}</attribute> |
|
|
|
</xpath> |
|
|
|
|
|
|
|
<xpath expr="//h1//field[@name='name']/.." position="after"> |
|
|
|
<div class="oe_edit_only"> |
|
|
|
<group attrs="{'invisible': [('is_company', '=', True)]}"> |
|
|
|
<field name="lastname" attrs= |
|
|
|
"{'required': [('firstname', '=', False), |
|
|
|
<field |
|
|
|
name="lastname" |
|
|
|
attrs="{'required': [('firstname', '=', False), |
|
|
|
('is_company', '=', False), |
|
|
|
('type', '=', 'contact')]}"/> |
|
|
|
<field name="firstname" attrs= |
|
|
|
"{'required': [('lastname', '=', False), |
|
|
|
('type', '=', 'contact')]}" |
|
|
|
/> |
|
|
|
<field |
|
|
|
name="firstname" |
|
|
|
attrs="{'required': [('lastname', '=', False), |
|
|
|
('is_company', '=', False), |
|
|
|
('type', '=', 'contact')]}"/> |
|
|
|
('type', '=', 'contact')]}" |
|
|
|
/> |
|
|
|
</group> |
|
|
|
</div> |
|
|
|
</xpath> |
|
|
|
|
|
|
|
<!-- Modify inner contact form of child_ids --> |
|
|
|
<xpath expr="//field[@name='child_ids']/form//field[@name='name']" |
|
|
|
position="attributes"> |
|
|
|
<xpath |
|
|
|
expr="//field[@name='child_ids']/form//field[@name='name']" |
|
|
|
position="attributes" |
|
|
|
> |
|
|
|
<attribute name="attrs">{ |
|
|
|
'readonly': [('is_company', '=', False)], |
|
|
|
'required': [('is_company', '=', True)] |
|
|
|
}</attribute> |
|
|
|
</xpath> |
|
|
|
|
|
|
|
<xpath expr="//field[@name='child_ids']/form//field[@name='name']" |
|
|
|
position="after"> |
|
|
|
<xpath |
|
|
|
expr="//field[@name='child_ids']/form//field[@name='name']" |
|
|
|
position="after" |
|
|
|
> |
|
|
|
<div class="oe_edit_only" colspan="2"> |
|
|
|
<field name="is_company" invisible="True" /> |
|
|
|
<group attrs="{'invisible': [('is_company', '=', True)]}"> |
|
|
|
<field name="lastname" attrs= |
|
|
|
"{'required': [('firstname', '=', False), |
|
|
|
<field |
|
|
|
name="lastname" |
|
|
|
attrs="{'required': [('firstname', '=', False), |
|
|
|
('is_company', '=', False), |
|
|
|
('type', '=', 'contact')]}"/> |
|
|
|
<field name="firstname" attrs= |
|
|
|
"{'required': [('lastname', '=', False), |
|
|
|
('type', '=', 'contact')]}" |
|
|
|
/> |
|
|
|
<field |
|
|
|
name="firstname" |
|
|
|
attrs="{'required': [('lastname', '=', False), |
|
|
|
('is_company', '=', False), |
|
|
|
('type', '=', 'contact')]}"/> |
|
|
|
('type', '=', 'contact')]}" |
|
|
|
/> |
|
|
|
</group> |
|
|
|
</div> |
|
|
|
</xpath> |
|
|
|