From 025d3eeed9e7303cfa5de81fed7dd3825e80187b Mon Sep 17 00:00:00 2001 From: resteve Date: Mon, 24 Aug 2015 15:24:08 +0200 Subject: [PATCH] New API for on_change --- address.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/address.py b/address.py index 0f3d713..bfe53e1 100644 --- a/address.py +++ b/address.py @@ -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):