summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-06-10 11:17:57 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-06-10 11:17:57 +0700
commit5ca33915f1e3d052cfa989163d43a15dbc9ddec9 (patch)
tree828c56626d0c298d17f3b698cc9fb5ae0db1f011 /indoteknik_custom/views
parent2760b81f8a650ea95d36c125d1ab4e2feb011e44 (diff)
(andri) add button get koordinat pada contact
Diffstat (limited to 'indoteknik_custom/views')
-rw-r--r--indoteknik_custom/views/res_partner.xml20
1 files changed, 20 insertions, 0 deletions
diff --git a/indoteknik_custom/views/res_partner.xml b/indoteknik_custom/views/res_partner.xml
index 9fb6530c..f4c1be31 100644
--- a/indoteknik_custom/views/res_partner.xml
+++ b/indoteknik_custom/views/res_partner.xml
@@ -68,6 +68,26 @@
<field name="vat" position="before">
<field name="latitude"/>
<field name="longtitude"/>
+
+ <button name="geocode_address" type="object" string="Cari Lokasi dari Alamat" class="btn btn-primary"/>
+
+ <separator string="Map Lokasi"/>
+ <div style="height: 400px;">
+ <t t-if="record.latitude.value and record.longtitude.value">
+ <t t-set="google_maps_api_key" t-value="request.env['ir.config_parameter'].sudo().get_param('google.maps.api_key')"/>
+ <iframe
+ t-att-src="'https://www.google.com/maps/embed/v1/place?key=' + google_maps_api_key + '&amp;q=' + str(record.latitude.value) + ',' + str(record.longtitude.value)"
+ width="100%"
+ height="400"
+ style="border:0;"
+ allowfullscreen=""
+ loading="lazy"
+ ></iframe>
+ </t>
+ <t t-else="">
+ <p>Isi alamat lalu klik "Cari Lokasi dari Alamat" untuk menampilkan peta.</p>
+ </t>
+ </div>
</field>
<field name="vat" position="after">
<field name="email_finance" widget="email"/>