Return first zip when search by subbisivion and country with multiples zips
This commit is contained in:
parent
85eb8352c6
commit
b67f219ce2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue