[MERGE] lp:~openerp-dev/openobject-server/trunk-10click-crm-partner-aja
bzr revid: jam@tinyerp.com-20121025102301-3wq6i87857ou0mtj
This commit is contained in:
commit
440fce00cd
|
@ -320,6 +320,14 @@ class res_partner(osv.osv, format_address):
|
|||
return {'value': dict((key, value_or_id(parent[key])) for key in ADDRESS_FIELDS)}
|
||||
return {}
|
||||
|
||||
def onchange_state(self, cr, uid, ids, state_id, context=None):
|
||||
country_id = False
|
||||
if state_id:
|
||||
country_id = self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id
|
||||
return {'value':{'state_id':state_id,
|
||||
'country_id':country_id,
|
||||
'zip':False}}
|
||||
|
||||
def _check_ean_key(self, cr, uid, ids, context=None):
|
||||
for partner_o in pooler.get_pool(cr.dbname).get('res.partner').read(cr, uid, ids, ['ean13',]):
|
||||
thisean=partner_o['ean13']
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
<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}'/>
|
||||
<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}'/>
|
||||
|
|
Loading…
Reference in New Issue