Return first zip when search by subbisivion and country with multiples zips
This commit is contained in:
parent
0b34a44aed
commit
0fda9bf18a
|
@ -24,7 +24,7 @@ class Address(metaclass=PoolMeta):
|
||||||
zips = Zip.search([
|
zips = Zip.search([
|
||||||
('zip', '=', self.zip),
|
('zip', '=', self.zip),
|
||||||
('subdivision.country', '=', self.country.id),
|
('subdivision.country', '=', self.country.id),
|
||||||
])
|
], limit=1)
|
||||||
if zips:
|
if zips:
|
||||||
zip_, = zips
|
zip_, = zips
|
||||||
self.city = zip_.city
|
self.city = zip_.city
|
||||||
|
|
Loading…
Reference in New Issue