From 7101e8134fc15969425bcc929ad1d14ed40ab340 Mon Sep 17 00:00:00 2001 From: "Bharat (OpenERP)" Date: Tue, 6 Sep 2011 15:55:10 +0530 Subject: [PATCH] [IMP] improved the sequence of files in __openerp__.py and improved the coding of google_map_launch.py bzr revid: bde@tinyerp.com-20110906102510-hgl0yoqze417ezvg --- addons/google_map/__openerp__.py | 4 ++-- addons/google_map/wizard/google_map_launch.py | 17 +++++++++-------- .../wizard/google_map_launch_view.xml | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/addons/google_map/__openerp__.py b/addons/google_map/__openerp__.py index c5ba79f70db..8f8d816d510 100644 --- a/addons/google_map/__openerp__.py +++ b/addons/google_map/__openerp__.py @@ -36,8 +36,8 @@ 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_view.xml', - 'wizard/google_map_launch_view.xml' + 'update_xml': ['wizard/google_map_launch_view.xml', + 'google_map_view.xml', ], 'demo_xml': [], 'installable': True, diff --git a/addons/google_map/wizard/google_map_launch.py b/addons/google_map/wizard/google_map_launch.py index c42aff61378..ea0e63869e9 100644 --- a/addons/google_map/wizard/google_map_launch.py +++ b/addons/google_map/wizard/google_map_launch.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -25,13 +25,14 @@ from osv import fields import time 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='' + _name = "launch.map" + _description = "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) url="http://maps.google.com/maps?oi=map&q=" if m.street: url+=m.street.replace(' ','+') diff --git a/addons/google_map/wizard/google_map_launch_view.xml b/addons/google_map/wizard/google_map_launch_view.xml index 23857cfa4df..5f7d89d18a4 100644 --- a/addons/google_map/wizard/google_map_launch_view.xml +++ b/addons/google_map/wizard/google_map_launch_view.xml @@ -22,7 +22,7 @@ Google Map launch.map form - tree,form,calendar,graph + form new