[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'],
'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,

View File

@ -27,11 +27,12 @@ import time
class launch_map(osv.osv_memory):
_name = "launch.map"
_description = "Google 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=''
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(' ','+')

View File

@ -22,7 +22,7 @@
<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="view_mode">form</field>
<field name="target">new</field>
<field name="view_id" ref="view_google_map_launch_form"/>
</record>