[IMP]:Improve onchange code for state
bzr revid: aja@tinyerp.com-20121025095805-isdu8d4ma2etx8vc
This commit is contained in:
parent
e23ade6f5d
commit
569e9037aa
|
@ -563,8 +563,10 @@ class res_partner(osv.osv, format_address):
|
|||
return address_format % args
|
||||
|
||||
def onchange_state(self, cr, uid, ids, state_id, context=None):
|
||||
state=self.pool.get('res.country.state').browse(cr, uid, state_id, context)
|
||||
return {'value':{'country_id':state.country_id.id,'zip':''}}
|
||||
if state_id:
|
||||
state=self.pool.get('res.country.state').browse(cr, uid, state_id, context)
|
||||
return {'value':{'state_id':state_id,'country_id':state.country_id.id,'zip':''}}
|
||||
return {'value':{'state_id':state_id,'country_id':'','zip':''}}
|
||||
# res.partner.address is deprecated; it is still there for backward compability only and will be removed in next version
|
||||
class res_partner_address(osv.osv):
|
||||
_table = "res_partner"
|
||||
|
|
Loading…
Reference in New Issue