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 b22c0b27c1
commit f09be8d1c7

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