Sylvain GARANCHER
8 years ago
committed by
Alex Comba
11 changed files with 109 additions and 122 deletions
-
7partner_firstname/__manifest__.py
-
4partner_firstname/models/res_partner.py
-
2partner_firstname/models/res_user.py
-
2partner_firstname/tests/base.py
-
2partner_firstname/tests/test_create.py
-
2partner_firstname/tests/test_defaults.py
-
2partner_firstname/tests/test_delete.py
-
2partner_firstname/tests/test_empty.py
-
2partner_firstname/tests/test_user_onchange.py
-
156partner_firstname/views/res_partner.xml
-
50partner_firstname/views/res_user.xml
@ -1,86 +1,82 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<odoo> |
|||
<record id="view_partner_simple_form_firstname" model="ir.ui.view"> |
|||
<field name="name">Add firstname and lastname</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_simple_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<xpath expr="//field[@name='name']" position="attributes"> |
|||
<attribute name="attrs">{ |
|||
'readonly': [('is_company', '=', False)], |
|||
'required': [('is_company', '=', True)] |
|||
}</attribute> |
|||
</xpath> |
|||
|
|||
<record id="view_partner_simple_form_firstname" model="ir.ui.view"> |
|||
<field name="name">Add firstname and lastname</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_simple_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<xpath expr="//field[@name='name']" position="attributes"> |
|||
<attribute name="attrs">{ |
|||
'readonly': [('is_company', '=', False)], |
|||
'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), |
|||
('is_company', '=', False)]}"/> |
|||
<field name="firstname" attrs= |
|||
"{'required': [('lastname', '=', False), |
|||
('is_company', '=', False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
</data> |
|||
</field> |
|||
</record> |
|||
|
|||
<xpath expr="//h1//field[@name='name']/.." position="before"> |
|||
<group attrs="{'invisible': [('is_company', '=', True)]}"> |
|||
<field name="lastname" attrs= |
|||
"{'required': [('firstname', '=', False), |
|||
('is_company', '=', False)]}"/> |
|||
<field name="firstname" attrs= |
|||
"{'required': [('lastname', '=', False), |
|||
('is_company', '=', False)]}"/> |
|||
</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> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<xpath expr="//field[@name='name']" position="attributes"> |
|||
<attribute name="attrs">{ |
|||
'readonly': [('is_company', '=', False)], |
|||
'required': [('is_company', '=', True)] |
|||
}</attribute> |
|||
</xpath> |
|||
|
|||
<record id="view_partner_form_firstname" model="ir.ui.view"> |
|||
<field name="name">Add firstname and surnames</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<xpath expr="//field[@name='name']" position="attributes"> |
|||
<attribute name="attrs">{ |
|||
'readonly': [('is_company', '=', False)], |
|||
'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), |
|||
('is_company', '=', False)]}"/> |
|||
<field name="firstname" attrs= |
|||
"{'required': [('lastname', '=', False), |
|||
('is_company', '=', False)]}"/> |
|||
</group> |
|||
</div> |
|||
</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), |
|||
('is_company', '=', False)]}"/> |
|||
<field name="firstname" attrs= |
|||
"{'required': [('lastname', '=', False), |
|||
('is_company', '=', False)]}"/> |
|||
</group> |
|||
</div> |
|||
</xpath> |
|||
<!-- Modify inner contact form of child_ids --> |
|||
<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> |
|||
|
|||
<!-- Modify inner contact form of child_ids --> |
|||
<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"> |
|||
<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), |
|||
('is_company', '=', False)]}"/> |
|||
<field name="firstname" attrs= |
|||
"{'required': [('lastname', '=', False), |
|||
('is_company', '=', False)]}"/> |
|||
</group> |
|||
</div> |
|||
</xpath> |
|||
</data> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
|||
<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), |
|||
('is_company', '=', False)]}"/> |
|||
<field name="firstname" attrs= |
|||
"{'required': [('lastname', '=', False), |
|||
('is_company', '=', False)]}"/> |
|||
</group> |
|||
</div> |
|||
</xpath> |
|||
</data> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -1,29 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<openerp> |
|||
<data> |
|||
<odoo> |
|||
<record id="view_users_form" model="ir.ui.view"> |
|||
<field name="name">Add firstname and surnames</field> |
|||
<field name="model">res.users</field> |
|||
<field name="inherit_id" ref="base.view_users_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<xpath expr="//field[@name='name']" position="attributes"> |
|||
<attribute name="readonly">True</attribute> |
|||
<attribute name="required">False</attribute> |
|||
</xpath> |
|||
|
|||
<record id="view_users_form" model="ir.ui.view"> |
|||
<field name="name">Add firstname and surnames</field> |
|||
<field name="model">res.users</field> |
|||
<field name="inherit_id" ref="base.view_users_form"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<xpath expr="//field[@name='name']" position="attributes"> |
|||
<attribute name="readonly">True</attribute> |
|||
<attribute name="required">False</attribute> |
|||
</xpath> |
|||
|
|||
<xpath expr="//field[@name='email']" position="after"> |
|||
<group> |
|||
<field name="lastname" |
|||
attrs="{'required': [('firstname', '=', False)]}"/> |
|||
<field name="firstname" |
|||
attrs="{'required': [('lastname', '=', False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
</data> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
|||
<xpath expr="//field[@name='email']" position="after"> |
|||
<group> |
|||
<field name="lastname" |
|||
attrs="{'required': [('firstname', '=', False)]}"/> |
|||
<field name="firstname" |
|||
attrs="{'required': [('lastname', '=', False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
</data> |
|||
</field> |
|||
</record> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue