Bharat Devnani (Open ERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-google_map_wizard-bde into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-google_map_wizard-bde/+merge/72677
Hello Sir,
I have converted wizard of google_map module from wizard.interface to
osv.osv_memory.
Thanks & Regards,
Devnani Bharat R.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-google_map_wizard-bde/+merge/72677
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-google_map_wizard-bde.
=== modified file 'google_map/__openerp__.py'
--- google_map/__openerp__.py 2011-07-06 12:29:28 +0000
+++ google_map/__openerp__.py 2011-08-24 06:46:24 +0000
@@ -36,7 +36,9 @@
'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,
=== modified file 'google_map/google_map_view.xml'
--- google_map/google_map_view.xml 2011-01-14 00:11:01 +0000
+++ google_map/google_map_view.xml 2011-08-24 06:46:24 +0000
@@ -12,7 +12,7 @@
<label string="Street2 : " align="1.0"/>
<group colspan="1" col="2">
<field name="street2" nolabel="1"/>
- <button name="%(wizard_google_map)d"
+ <button name="%(action_google_map_launch_form)d"
string="Map" type="action" icon="gtk-zoom-in"/>
</group>
</field>
@@ -29,7 +29,7 @@
<label string="Street2 : " align="1.0"/>
<group colspan="1" col="2">
<field name="street2" nolabel="1"/>
- <button name="%(wizard_google_map)d" string="Map" type="action" icon="gtk-zoom-in"/>
+ <button name="%(action_google_map_launch_form)d" string="Map" type="action" icon="gtk-zoom-in"/>
</group>
</field>
</field>
@@ -46,7 +46,7 @@
<label string="Street2 : " align="1.0"/>
<group colspan="1" col="2">
<field name="street2" nolabel="1"/>
- <button name="%(wizard_google_map)d"
+ <button name="%(action_google_map_launch_form)d"
string="Map" type="action" icon="gtk-zoom-in"/>
</group>
</field>
=== removed file 'google_map/google_map_wizard.xml'
--- google_map/google_map_wizard.xml 2011-01-14 00:11:01 +0000
+++ google_map/google_map_wizard.xml 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0" ?>
-<openerp>
- <data>
-
- <wizard
- string="Launch Google Map"
- model="res.partner.address"
- name="google_map_launch"
- id="wizard_google_map"
- keyword="client_action_multi"/>
- </data>
-</openerp>
=== modified file 'google_map/wizard/google_map_launch.py'
--- google_map/wizard/google_map_launch.py 2011-01-14 00:11:01 +0000
+++ google_map/wizard/google_map_launch.py 2011-08-24 06:46:24 +0000
@@ -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(wizard.interface):
-
- states= {'init' : {'actions': [],
- 'result':{'type':'action',
- 'action': _launch_wizard,
- 'state':'end'}
- }
- }
-launch_map('google_map_launch')
+class launch_map(osv.osv_memory):
+
+ _name = "launch.map"
+
+ 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'
+ }
+
+launch_map()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'google_map/wizard/google_map_launch_view.xml'
--- google_map/wizard/google_map_launch_view.xml 1970-01-01 00:00:00 +0000
+++ google_map/wizard/google_map_launch_view.xml 2011-08-24 06:46:24 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="view_google_map_launch_form" model="ir.ui.view">
+ <field name="name">launch.map.form</field>
+ <field name="model">launch.map</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Launch Map">
+ <group colspan="4">
+ <separator string="Launch Map"/>
+ <newline/>
+ <button name="launch_wizard" string="Map" type="object" icon="gtk-zoom-in"/>
+ <button string="Cancel" icon="gtk-cancel" special="cancel"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_google_map_launch_form" model="ir.actions.act_window">
+ <field name="name">Google Map</field>
+ <field name="res_model">launch.map</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form,calendar,graph</field>
+ <field name="target">new</field>
+ <field name="view_id" ref="view_google_map_launch_form"/>
+ </record>
+
+ </data>
+</openerp>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp