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 1c267a386d
commit 7a125441af
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ class Address:
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