[IMP] base/res/partner: rename field and improve partner form
bzr revid: rco@openerp.com-20120223145426-7q18zqbt0wqwvzpf
This commit is contained in:
parent
f72fc4acfa
commit
a70e1fef3d
|
@ -156,7 +156,7 @@ class res_partner(osv.osv):
|
|||
'mobile': fields.char('Mobile', size=64),
|
||||
'birthdate': fields.char('Birthdate', size=64),
|
||||
'is_company': fields.boolean('Company', help="Check if the partner is a company, uncheck it for a person"),
|
||||
'is_company_address': fields.boolean('Use Parent Address', help="Check to use the parent partner's address"),
|
||||
'use_parent_address': fields.boolean('Use Company Address', help="Check to use the company's address"),
|
||||
'photo': fields.binary('Photo'),
|
||||
'company_id': fields.many2one('res.company', 'Company', select=1),
|
||||
'color': fields.integer('Color Index'),
|
||||
|
@ -188,8 +188,8 @@ class res_partner(osv.osv):
|
|||
def do_share(self, cr, uid, ids, *args):
|
||||
return True
|
||||
|
||||
def onchange_address(self, cr, uid, ids, is_company_address, parent_id, context=None):
|
||||
if is_company_address and parent_id:
|
||||
def onchange_address(self, cr, uid, ids, use_parent_address, parent_id, context=None):
|
||||
if use_parent_address and parent_id:
|
||||
parent = self.browse(cr, uid, parent_id, context=context)
|
||||
return {'value': {
|
||||
'street': parent.street,
|
||||
|
|
|
@ -323,54 +323,50 @@
|
|||
<field name="model">res.partner</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partners" col='1'>
|
||||
<form string="Partners">
|
||||
<group col="8" colspan="4">
|
||||
<group colspan="4" col="4">
|
||||
<group col="2">
|
||||
<field name="name" select="1"/>
|
||||
<field name="function"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="title" size="0" groups="base.group_extended"/>
|
||||
<field name="parent_id" string="Parent Company" groups="base.group_extended" attrs="{'invisible': [('is_company','=', True)]}"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="name"/>
|
||||
<field name="parent_id" string="Company" attrs="{'invisible': [('is_company','=', True)]}"/>
|
||||
<field name="function" attrs="{'invisible': [('is_company','=', True)]}"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="customer" select="1"/>
|
||||
<field name="title" size="0" groups="base.group_extended"/>
|
||||
<field name="is_company"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="customer"/>
|
||||
<field name="supplier"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="is_company" select="1"/>
|
||||
<field name="is_company_address" on_change="onchange_address(is_company_address, parent_id)"/>
|
||||
</group>
|
||||
<group col="2">
|
||||
<field name="photo" widget='image' nolabel="1"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
<newline/>
|
||||
<group colspan="2" col="4" >
|
||||
<separator string="Address" colspan="4" col="4" />
|
||||
<field name="type" string="Type" colspan="2" attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
<field name="street" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="street2" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="zip" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="city" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="country_id" completion="1" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="state_id" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<group colspan="2">
|
||||
<separator string="Address" colspan="4"/>
|
||||
<field name="type" string="Type"/>
|
||||
<field name="use_parent_address" attrs="{'invisible': [('parent_id', '=', False)]}"
|
||||
on_change="onchange_address(use_parent_address, parent_id)"/>
|
||||
<newline/>
|
||||
<field name="street" colspan="4" attrs="{'readonly': [('use_parent_address','=', True)]}"/>
|
||||
<field name="street2" colspan="4" attrs="{'readonly': [('use_parent_address','=', True)]}"/>
|
||||
<field name="zip" attrs="{'readonly': [('use_parent_address','=', True)]}"/>
|
||||
<field name="city" attrs="{'readonly': [('use_parent_address','=', True)]}"/>
|
||||
<field name="country_id" completion="1" attrs="{'readonly': [('use_parent_address','=', True)]}"/>
|
||||
<field name="state_id" attrs="{'readonly': [('use_parent_address','=', True)]}"/>
|
||||
</group>
|
||||
<group colspan="2" col="4">
|
||||
<group colspan="2">
|
||||
<separator string="Communication" colspan="4"/>
|
||||
<field name="phone" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="lang" colspan="4"/>
|
||||
<field name="phone" colspan="4"/>
|
||||
<field name="mobile" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="fax" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="email" widget="email" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="website" widget="url" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="ref" groups="base.group_extended" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
<field name="lang" colspan="4" attrs="{'readonly': [('is_company','=', True)]}"/>
|
||||
</group>
|
||||
<field name="fax" colspan="4"/>
|
||||
<field name="email" widget="email" colspan="4"/>
|
||||
<field name="website" widget="url" colspan="4"/>
|
||||
<field name="ref" groups="base.group_extended" colspan="4"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible': [('is_company','=', False)]}">
|
||||
<field name="child_ids" nolabel="1"/>
|
||||
</group>
|
||||
|
@ -385,11 +381,11 @@
|
|||
</page>
|
||||
<page string="History" groups="base.group_extended" invisible="True">
|
||||
</page>
|
||||
<page string="Category" groups="base.group_extended">
|
||||
<field name="category_id" nolabel="1" colspan="8" />
|
||||
<page string="Categories" groups="base.group_extended">
|
||||
<field name="category_id" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Notes">
|
||||
<field colspan="4" name="comment" nolabel="1"/>
|
||||
<field name="comment" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue