[IMP]on change of country > If the selected state is of same country then don't change it and if it is of any other country then make it blank

bzr revid: vja@tinyerp.com-20130515133450-db0xs8fmm67t9orj
This commit is contained in:
Vishmita Jadeja (openerp) 2013-05-15 19:04:50 +05:30
parent 6f953c189a
commit 8c9675e75e
1 changed files with 4 additions and 1 deletions

View File

@ -179,10 +179,13 @@ class res_company(osv.osv):
return {'value':{'country_id': self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id }}
return {}
def on_change_country(self, cr, uid, ids, country_id, context=None):
res = {'domain': {'state_id': []}}
currency_id = self._get_euro(cr, uid, context=context)
if country_id:
currency_id = self.pool.get('res.country').browse(cr, uid, country_id, context=context).currency_id.id
return {'value': {'currency_id': currency_id, 'state_id': False},'domain':{'state_id': [('country_id','=',country_id)]}}
res['domain'] = {'state_id': [('country_id','=',country_id)]}
res['value'] = {'currency_id': currency_id}
return res
def _search(self, cr, uid, args, offset=0, limit=None, order=None,
context=None, count=False, access_rights_uid=None):