[FIX] website contact us: add google_map_img on res.company insead of use partner_id field
bzr revid: chm@openerp.com-20131104165954-o77oi2miksvvt81r
This commit is contained in:
parent
8eb74b717e
commit
49384720c0
|
@ -471,6 +471,15 @@ class res_partner(osv.osv):
|
|||
}
|
||||
return urlplus('https://maps.google.be/maps' , params)
|
||||
|
||||
class res_company(osv.osv):
|
||||
_inherit = "res.company"
|
||||
def google_map_img(self, cr, uid, ids, zoom=8, width=298, height=298, context=None):
|
||||
partner = self.browse(cr, openerp.SUPERUSER_ID, ids[0], context=context).parent_id
|
||||
return partner and partner.google_map_img(zoom, width, height, context=context) or None
|
||||
def google_map_link(self, cr, uid, ids, zoom=8, context=None):
|
||||
partner = self.browse(cr, openerp.SUPERUSER_ID, ids[0], context=context).parent_id
|
||||
return partner and partner.google_map_link(zoom, context=context) or None
|
||||
|
||||
class base_language_install(osv.osv):
|
||||
_inherit = "base.language.install"
|
||||
_columns = {
|
||||
|
|
|
@ -468,8 +468,8 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
|
|||
<span>&#x2706; <span t-field="res_company.phone"></span></span><br />
|
||||
<i class="icon-envelope"></i> <span t-field="res_company.email"></span>
|
||||
</address>
|
||||
<a t-att-href="res_company.partner_id.google_map_link()" target="_BLANK">
|
||||
<img class="thumbnail img-responsive" t-att-src="res_company.partner_id.google_map_img()" />
|
||||
<a t-att-href="res_company.google_map_link()" target="_BLANK">
|
||||
<img class="thumbnail img-responsive" t-att-src="res_company.google_map_img()" />
|
||||
</a>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Reference in New Issue