mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
FIX sale_planner Issue where ZIP with additional '-' does not geolocate
This commit is contained in:
@@ -60,8 +60,8 @@ class FakePartner():
|
||||
# The fast way.
|
||||
if ZipcodeSearchEngine and self.zip:
|
||||
with ZipcodeSearchEngine() as search:
|
||||
zipcode = search.by_zipcode(self.zip)
|
||||
if zipcode:
|
||||
zipcode = search.by_zipcode(str(self.zip).split('-')[0])
|
||||
if zipcode and zipcode['Latitude']:
|
||||
self.partner_latitude = zipcode['Latitude']
|
||||
self.partner_longitude = zipcode['Longitude']
|
||||
return self.date_localization
|
||||
|
||||
Reference in New Issue
Block a user