summaryrefslogtreecommitdiff
path: root/addons/google_map/wizard/google_map_launch.py
diff options
context:
space:
mode:
authorBharat (OpenERP) <bde@tinyerp.com>2011-09-07 16:06:15 +0530
committerBharat (OpenERP) <bde@tinyerp.com>2011-09-07 16:06:15 +0530
commit7a5c4d999b3db8a08a723e9324fe3038088cc4eb (patch)
treee41942d83e3305f1c4984cd10e49ffd04e57f381 /addons/google_map/wizard/google_map_launch.py
parent6d97d0922ede523b381655f0a305212ba4832e95 (diff)
[REM] removed unnecessary headers and given meaningful variable name in google_map_launch.py
bzr revid: bde@tinyerp.com-20110907103615-lstvq6gf37nrf4fy
Diffstat (limited to 'addons/google_map/wizard/google_map_launch.py')
-rw-r--r--addons/google_map/wizard/google_map_launch.py33
1 files changed, 15 insertions, 18 deletions
diff --git a/addons/google_map/wizard/google_map_launch.py b/addons/google_map/wizard/google_map_launch.py
index ea0e63869e9..12c7142fbb4 100644
--- a/addons/google_map/wizard/google_map_launch.py
+++ b/addons/google_map/wizard/google_map_launch.py
@@ -19,33 +19,30 @@
#
##############################################################################
-from osv import osv
-import pooler
-from osv import fields
-import time
+from osv import osv, fields
class launch_map(osv.osv_memory):
_name = "launch.map"
- _description = "Google Map"
+ _description = "Launch Google Map"
def launch_wizard(self, cr, uid, ids, context=None):
active_id = context.get('active_id', False)
address_obj= self.pool.get('res.partner.address')
- m = address_obj.browse(cr, uid, active_id, context=context)
+ partner = address_obj.browse(cr, uid, active_id, context=context)
url="http://maps.google.com/maps?oi=map&q="
- if m.street:
- url+=m.street.replace(' ','+')
- if m.street2:
- url+='+'+m.street2.replace(' ','+')
- if m.city:
- url+='+'+m.city.replace(' ','+')
- if m.state_id:
- url+='+'+m.state_id.name.replace(' ','+')
- if m.country_id:
- url+='+'+m.country_id.name.replace(' ','+')
- if m.zip:
- url+='+'+m.zip.replace(' ','+')
+ if partner.street:
+ url+=partner.street.replace(' ','+')
+ if partner.street2:
+ url+='+'+partner.street2.replace(' ','+')
+ if partner.city:
+ url+='+'+partner.city.replace(' ','+')
+ if partner.state_id:
+ url+='+'+partner.state_id.name.replace(' ','+')
+ if partner.country_id:
+ url+='+'+partner.country_id.name.replace(' ','+')
+ if partner.zip:
+ url+='+'+partner.zip.replace(' ','+')
return {
'type': 'ir.actions.act_url',
'url':url,