Return first zip when search by subbisivion and country with multiples zips

This commit is contained in:
Raimon Esteve 2019-09-16 13:48:16 +02:00
parent 0b34a44aed
commit 0fda9bf18a
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ class Address(metaclass=PoolMeta):
zips = Zip.search([
('zip', '=', self.zip),
('subdivision.country', '=', self.country.id),
])
], limit=1)
if zips:
zip_, = zips
self.city = zip_.city