On Change zip/country with city + subdivision decorator
This commit is contained in:
parent
2f5431c9e9
commit
d4bbcc000d
|
@ -27,15 +27,15 @@ class Address:
|
|||
('subdivision.country', '=', self.country.id),
|
||||
])
|
||||
if zips:
|
||||
zip_ = zips[0]
|
||||
zip_, = zips
|
||||
self.city = zip_.city
|
||||
if zip_.subdivision:
|
||||
self.subdivision = zip_.subdivision.id
|
||||
self.subdivision = zip_.subdivision
|
||||
|
||||
@fields.depends('zip', 'country')
|
||||
@fields.depends('zip', 'country', 'city', 'subdivision')
|
||||
def on_change_zip(self):
|
||||
return self.get_subdivision_country()
|
||||
|
||||
@fields.depends('zip', 'country')
|
||||
@fields.depends('zip', 'country', 'city', 'subdivision')
|
||||
def on_change_country(self):
|
||||
return self.get_subdivision_country()
|
||||
|
|
Loading…
Reference in New Issue