[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
This commit is contained in:
Bharat (OpenERP) 2011-09-06 15:55:10 +05:30
parent ad09b92e2e
commit 7101e8134f
3 changed files with 12 additions and 11 deletions

View File

@ -36,8 +36,8 @@ Using this you can directly open Google Map from the URL widget.""",
'images': ['images/google_map.jpeg'], 'images': ['images/google_map.jpeg'],
'depends': ['base'], 'depends': ['base'],
'init_xml': [], 'init_xml': [],
'update_xml': ['google_map_view.xml', 'update_xml': ['wizard/google_map_launch_view.xml',
'wizard/google_map_launch_view.xml' 'google_map_view.xml',
], ],
'demo_xml': [], 'demo_xml': [],
'installable': True, 'installable': True,

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# #
@ -15,7 +15,7 @@
# GNU Affero General Public License for more details. # GNU Affero General Public License for more details.
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## ##############################################################################
@ -25,13 +25,14 @@ from osv import fields
import time import time
class launch_map(osv.osv_memory): class launch_map(osv.osv_memory):
_name = "launch.map"
def launch_wizard(self, cr, uid, data, context=None): _name = "launch.map"
address_obj= pooler.get_pool(cr.dbname).get('res.partner.address') _description = "Google Map"
m = address_obj.browse(cr, uid, data, context=context)[0]
url='' 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=" url="http://maps.google.com/maps?oi=map&q="
if m.street: if m.street:
url+=m.street.replace(' ','+') url+=m.street.replace(' ','+')

View File

@ -22,7 +22,7 @@
<field name="name">Google Map</field> <field name="name">Google Map</field>
<field name="res_model">launch.map</field> <field name="res_model">launch.map</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field> <field name="view_mode">form</field>
<field name="target">new</field> <field name="target">new</field>
<field name="view_id" ref="view_google_map_launch_form"/> <field name="view_id" ref="view_google_map_launch_form"/>
</record> </record>