[IMP] base, res_partner and contacts management: improve usability and user experience.

1) whennever a contact is created from a parent record: allow to set a dedicated address
2) move the use_parent_address field near the address

bzr revid: qdp-launchpad@openerp.com-20130408155934-bk2apzq1gcktqr6m
This commit is contained in:
Quentin (OpenERP)
2013-04-08 17:59:34 +02:00
parent 2bf1034cd2
commit 70fbc25d93
+25 -9
View File
@@ -141,11 +141,6 @@
domain="[('is_company', '=', True)]" context="{'default_is_company': True}"
attrs="{'invisible': [('is_company','=', True)]}"
on_change="onchange_address(use_parent_address, parent_id)" class="oe_inline"/>
<field name="use_parent_address" class="oe_edit_only oe_inline"
on_change="onchange_address(use_parent_address, parent_id)"
attrs="{'invisible': [('parent_id','=', False)]}"/>
<label for="use_parent_address" class="oe_edit_only"
attrs="{'invisible': [('parent_id','=', False)]}"/>
<field name="category_id" widget="many2many_tags" placeholder="Tags..."/>
</div>
<div class="oe_right oe_button_box" name="buttons"> </div>
@@ -160,6 +155,10 @@
<label for="street" string="Address"/>
<div>
<field name="use_parent_address" class="oe_edit_only oe_inline"
on_change="onchange_address(use_parent_address, parent_id)"
attrs="{'invisible': [('parent_id','=', False)]}"/>
<label for="use_parent_address" class="oe_edit_only" attrs="{'invisible': [('parent_id','=', False)]}"/>
<button name="open_parent" type="object" string="(edit company address)" class="oe_link oe_edit_only"
attrs="{'invisible': ['|',('parent_id','=', False),('use_parent_address','=',False)]}"/>
<field name="street" placeholder="Street..." attrs="{'readonly': [('use_parent_address','=',True)]}"/>
@@ -187,7 +186,7 @@
<notebook colspan="4">
<page string="Contacts" attrs="{'invisible': [('is_company','=',False)]}">
<field name="child_ids" context="{'default_parent_id': active_id, 'default_use_parent_address': 1}" mode="kanban">
<field name="child_ids" context="{'default_parent_id': active_id, 'default_use_parent_address': True}" mode="kanban">
<kanban>
<field name="color"/>
<field name="name"/>
@@ -254,9 +253,8 @@
</kanban>
<form string="Contact" version="7.0">
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<group>
<group>
<field name="use_parent_address"/>
<field name="name"/>
<field name="category_id" widget="many2many_tags" placeholder="Tags..."/>
<field name="function" placeholder="e.g. Sales Director"/>
@@ -264,7 +262,25 @@
<field name="phone"/>
<field name="mobile"/>
</group>
</div>
<group>
<field name="use_parent_address"/>
<label for="type" attrs="{'invisible': [('use_parent_address','=', True)]}"/>
<div attrs="{'invisible': [('use_parent_address','=', True)]}" name="div_type">
<field class="oe_inline" name="type"/>
</div>
<label for="street" string="Address" attrs="{'invisible': [('use_parent_address','=', True)]}"/>
<div attrs="{'invisible': [('use_parent_address','=', True)]}" name="div_address">
<field name="street" placeholder="Street..."/>
<field name="street2"/>
<div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/>
<field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
<field name="zip" placeholder="ZIP" style="width: 20%%"/>
</div>
<field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}'/>
</div>
</group>
</group>
</form>
</field>
</page>