diff --git a/addons/google_map/__openerp__.py b/addons/google_map/__openerp__.py
index 5c48a9370d7..c5ba79f70db 100644
--- a/addons/google_map/__openerp__.py
+++ b/addons/google_map/__openerp__.py
@@ -36,7 +36,9 @@ Using this you can directly open Google Map from the URL widget.""",
'images': ['images/google_map.jpeg'],
'depends': ['base'],
'init_xml': [],
- 'update_xml': ['google_map_wizard.xml', 'google_map_view.xml'],
+ 'update_xml': ['google_map_view.xml',
+ 'wizard/google_map_launch_view.xml'
+ ],
'demo_xml': [],
'installable': True,
'active': False,
diff --git a/addons/google_map/google_map_view.xml b/addons/google_map/google_map_view.xml
index 7909b271cd4..cd2648599dc 100644
--- a/addons/google_map/google_map_view.xml
+++ b/addons/google_map/google_map_view.xml
@@ -12,7 +12,7 @@
-
@@ -29,7 +29,7 @@
-
+
@@ -46,7 +46,7 @@
-
diff --git a/addons/google_map/google_map_wizard.xml b/addons/google_map/google_map_wizard.xml
deleted file mode 100644
index 2f3b3b2a178..00000000000
--- a/addons/google_map/google_map_wizard.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/addons/google_map/wizard/google_map_launch.py b/addons/google_map/wizard/google_map_launch.py
index a2b3003da7c..c42aff61378 100644
--- a/addons/google_map/wizard/google_map_launch.py
+++ b/addons/google_map/wizard/google_map_launch.py
@@ -19,43 +19,38 @@
#
##############################################################################
-import wizard
from osv import osv
import pooler
from osv import fields
import time
-def _launch_wizard(self, cr, uid, data, context=None):
- address_obj= pooler.get_pool(cr.dbname).get('res.partner.address')
- m= address_obj.browse(cr, uid, data['id'], context=context)
- url=''
- 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(' ','+')
- return {
- 'type': 'ir.actions.act_url',
- 'url':url,
- 'target': 'new'
- }
+class launch_map(osv.osv_memory):
+
+ _name = "launch.map"
-class launch_map(wizard.interface):
+ def launch_wizard(self, cr, uid, data, context=None):
+ address_obj= pooler.get_pool(cr.dbname).get('res.partner.address')
+ m = address_obj.browse(cr, uid, data, context=context)[0]
+ url=''
+ 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(' ','+')
+ return {
+ 'type': 'ir.actions.act_url',
+ 'url':url,
+ 'target': 'new'
+ }
- states= {'init' : {'actions': [],
- 'result':{'type':'action',
- 'action': _launch_wizard,
- 'state':'end'}
- }
- }
-launch_map('google_map_launch')
+launch_map()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/google_map/wizard/google_map_launch_view.xml b/addons/google_map/wizard/google_map_launch_view.xml
new file mode 100644
index 00000000000..23857cfa4df
--- /dev/null
+++ b/addons/google_map/wizard/google_map_launch_view.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ launch.map.form
+ launch.map
+ form
+
+
+
+
+
+
+ Google Map
+ launch.map
+ form
+ tree,form,calendar,graph
+ new
+
+
+
+
+