rework url-construction of goMaps
parent
719fb29d84
commit
9f2521822e
|
|
@ -10,10 +10,11 @@ class TZgoMaps(models.Model):
|
||||||
def goMaps(self):
|
def goMaps(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
street = record.street+',' if record.street else ''
|
street = record.street+',' if record.street else ''
|
||||||
zip = record.zip+',' if record.zip else ''
|
zip = ' '+record.zip+',' if record.zip else ''
|
||||||
city = record.city+',' if record.city else ''
|
city = ' '+record.city+',' if record.city else ''
|
||||||
country_code = record.country_id.code+',' if record.country_id.code else ''
|
country_code = ' '+record.country_id.code+',' if record.country_id.code else ''
|
||||||
gomaps_link = 'https://www.google.com/maps/place/'+street.replace('/','.')+zip+city+country_code
|
# gomaps_link = 'https://www.google.com/maps/place/'+street.replace('/','.')+zip+city+country_code
|
||||||
|
gomaps_link = 'https://www.google.com/maps/place/' + street + zip + city + country_code
|
||||||
return {
|
return {
|
||||||
'type': 'ir.actions.act_url',
|
'type': 'ir.actions.act_url',
|
||||||
'url': '%s' % gomaps_link,
|
'url': '%s' % gomaps_link,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue