[FIX] partner: backport of trunk revision 4882

When adding a new contact or a new company based from the partner form, use the customer value as default value (was doign it only for the supplier flag)

bzr revid: mat@openerp.com-20140311112341-9yoi1hf0ks98ju3r
This commit is contained in:
Martin Trigaux 2014-03-11 12:23:41 +01:00
parent a4c27d560d
commit 8a3523cd97
1 changed files with 3 additions and 2 deletions

View File

@ -138,7 +138,7 @@
</h1>
<field name="parent_id"
placeholder="Company"
domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'default_supplier': supplier}"
domain="[('is_company', '=', True)]" context="{'default_is_company': True, 'default_supplier': supplier, 'default_customer': customer}"
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..."/>
@ -186,7 +186,7 @@
<notebook colspan="4">
<page string="Contacts" attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}" 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}">
<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, 'default_customer': customer}">
<kanban>
<field name="color"/>
<field name="name"/>
@ -286,6 +286,7 @@
</div>
</group>
<field name="supplier" invisible="True"/>
<field name="customer" invisible="True"/>
</sheet>
</form>
</field>