1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/industry_fsm/models/res_partner.py
2024-12-10 09:04:09 +07:00

20 lines
538 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
import urllib.parse
from odoo import models
class ResPartner(models.Model):
_inherit = 'res.partner'
def action_partner_navigate(self):
self.ensure_one()
encoded_address = urllib.parse.quote_plus(self.contact_address_complete)
url = f"https://www.google.com/maps/dir/?api=1&destination={encoded_address}"
return {
'type': 'ir.actions.act_url',
'url': url,
'target': 'new'
}