[FIX] res.partner: avoid hiding `parent_id` and `child_ids` fields if they are set, irregardless of the rest of the `is_company` flag

This prevents hiding real data and also allows creating more
complex/flexible structures by setting the values of these
fields before or after setting is_company, to reach the
desired result.

bzr revid: odo@openerp.com-20130416093403-9m484d30qqq5ab8l
This commit is contained in:
Olivier Dony 2013-04-16 11:34:03 +02:00
parent d734bf58cc
commit 06cd0a1c7f
1 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,7 @@
<field name="parent_id"
placeholder="Company"
domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'default_supplier': supplier}"
attrs="{'invisible': [('is_company','=', True)]}"
attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)]}"
on_change="onchange_address(use_parent_address, parent_id)"/>
<field name="category_id" widget="many2many_tags" placeholder="Tags..."/>
</div>
@ -185,7 +185,7 @@
</group>
<notebook colspan="4">
<page string="Contacts" attrs="{'invisible': [('is_company','=',False)]}" autofocus="autofocus">
<page string="Contacts" attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', False)]}" autofocus="autofocus">
<field name="child_ids" mode="kanban" context="{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier}">
<kanban>
<field name="color"/>