summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-06-17 08:47:53 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-06-17 08:47:53 +0700
commita80565682063e718fc55c90e4243b9d5b2432285 (patch)
treebd3b65cc54b62a8994bafb5d38c25631888d6414 /indoteknik_custom/models
parenta8460239603b7a73a185fec394b0f95ab0247207 (diff)
(andri) fix load gmaps pada view & edit
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/res_partner.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py
index a8ce95d1..9986b9c0 100644
--- a/indoteknik_custom/models/res_partner.py
+++ b/indoteknik_custom/models/res_partner.py
@@ -579,9 +579,10 @@ class ResPartner(models.Model):
])
# Ambil API Key
- api_key = self.env['ir.config_parameter'].sudo().get_param('google.maps.api_key')
- if not api_key:
- raise UserError("API Key Google Maps belum dikonfigurasi. Silakan isi melalui Settings.")
+ api_key = "AIzaSyB7bG9aSNAJnSrj0Z7f1abFsqKVoiJfsPE"
+ # api_key = self.env['ir.config_parameter'].sudo().get_param('google.maps.api_key')
+ # if not api_key:
+ # raise UserError("API Key Google Maps belum dikonfigurasi. Silakan isi melalui Settings.")
# Request ke Google Maps
url = f'https://maps.googleapis.com/maps/api/geocode/json?address={address}&key={api_key}'
@@ -638,9 +639,10 @@ class ResPartner(models.Model):
def _reverse_geocode(self, lat, lng):
- api_key = self.env['ir.config_parameter'].sudo().get_param('google.maps.api_key')
- if not api_key:
- raise UserError("API Key Google Maps belum dikonfigurasi.")
+ api_key = "AIzaSyB7bG9aSNAJnSrj0Z7f1abFsqKVoiJfsPE"
+ # api_key = self.env['ir.config_parameter'].sudo().get_param('google.maps.api_key')
+ # if not api_key:
+ # raise UserError("API Key Google Maps belum dikonfigurasi.")
url = f'https://maps.googleapis.com/maps/api/geocode/json?latlng={lat},{lng}&key={api_key}'
response = requests.get(url)