<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2022 - Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
        <record id="view_res_company_form" model="ir.ui.view">
            <field name="model">res.company</field>
            <field name="inherit_id" ref="base.view_company_form" />
            <field name="arch" type="xml">
                <xpath expr="//notebook[last()]" position="inside">
                    <page string="Partner Assignment" name="geo_location">
                        <group>
                            <group string="Geolocation">
                                <label for="date_localization" string="Geo Location" />
                                <div>
                                    <span>Lat: <field
                                        name="partner_latitude"
                                        nolabel="1"
                                        class="oe_inline"
                                    /></span>
                                    <br />
                                    <span>Long: <field
                                        name="partner_longitude"
                                        nolabel="1"
                                        class="oe_inline"
                                    /></span>
                                    <br />
                                    <span
                                    attrs="{'invisible': [('date_localization', '=', False)]}"
                                >Updated on:
                                        <field
                                        name="date_localization"
                                        nolabel="1"
                                        readonly="1"
                                        class="oe_inline"
                                    />
                                        <br />
                                    </span>
                                    <button
                                    attrs="{'invisible': ['|', ('partner_latitude', '!=', 0), ('partner_longitude', '!=', 0)]}"
                                    icon="fa-gear"
                                    string="Compute based on address"
                                    title="Compute Localization"
                                    name="geo_localize"
                                    type="object"
                                    class="btn btn-link p-0"
                                />
                                    <button
                                    attrs="{'invisible': [('partner_latitude', '=', 0), ('partner_longitude', '=', 0)]}"
                                    icon="fa-refresh"
                                    string="Refresh"
                                    title="Refresh Localization"
                                    name="geo_localize"
                                    type="object"
                                    class="btn btn-link p-0"
                                />
                                </div>
                            </group>
                        </group>
                    </page>
                </xpath>
            </field>
        </record>
</odoo>
