New API for on_change

This commit is contained in:
resteve 2015-08-24 15:24:08 +02:00
parent 937c4ea066
commit 025d3eeed9
1 changed files with 2 additions and 4 deletions

View File

@ -19,7 +19,6 @@ class Address:
return config.default_country.id
def get_subdivision_country(self):
res = {}
Zip = Pool().get('country.zip')
if self.zip and self.country:
@ -29,10 +28,9 @@ class Address:
])
if zips:
zip_ = zips[0]
res['city'] = zip_.city
self.city = zip_.city
if zip_.subdivision:
res['subdivision'] = zip_.subdivision.id
return res
self.subdivision = zip_.subdivision.id
@fields.depends('zip', 'country')
def on_change_zip(self):