Return first zip when search by subbisivion and country with multiples zips
This commit is contained in:
parent
1c267a386d
commit
7a125441af
|
@ -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