Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
5107 Переглядів

I have added two fields 'latitude' and 'longitude' in project form view. The user needs to fill these two fields by clicking on a button inside the form view and to select the place from pop up displaying google map. What is the best way to implement this?

Аватар
Відмінити
Найкраща відповідь

Hello GopaKumar N G,

latitude and longitude in form view from Google Map

Place one button in form view and click method call from js 

like this,

<button string ="Geo-Location" id="geolocation_id">

this._super.apply(this, arguments);

            var self = this;

            $el.click(function(ev) {

                if (node.attrs.id === "geolocation_id") {

# Here You can Open Google map

# and get latitude and longitude values and pass it to python and update your form view field.

Thank You!

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Аватар
Відмінити
Автор

Could you explain in detail

Найкраща відповідь

Hi,


Please check this: https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
лист. 20
7305
2
вер. 25
1034
1
вер. 24
3462
4
трав. 24
13828
1
квіт. 24
4200