diff options
| author | Bharat (OpenERP) <bde@tinyerp.com> | 2011-08-24 12:12:33 +0530 |
|---|---|---|
| committer | Bharat (OpenERP) <bde@tinyerp.com> | 2011-08-24 12:12:33 +0530 |
| commit | ad09b92e2e3eea61afeb30a447436a6900450acd (patch) | |
| tree | 29818aec55196cf6ec1093fc673cf3442dbce0dc /addons/google_map/wizard/google_map_launch.py | |
| parent | ae7b1699cb3d0ae8863c2669972913884c95a6c9 (diff) | |
[CONVERT] converted wizard.interface to osv.osv_memory for google_map module
bzr revid: bde@tinyerp.com-20110824064233-jvf01fvdbtrcufgs
Diffstat (limited to 'addons/google_map/wizard/google_map_launch.py')
| -rw-r--r-- | addons/google_map/wizard/google_map_launch.py | 57 |
1 files changed, 26 insertions, 31 deletions
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: |
