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 85eb8352c6
commit b67f219ce2
1 changed files with 1 additions and 1 deletions

View File

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