Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
10194 Представления

Hi,
how to get Geo-Location (GPS-Coordinates) in Odoo form where the user post the entry...and save in database.

For Eample
i want to save user location in database where he post any entry .

Аватар
Отменить
Лучший ответ

Seems like via the controller but how does one consume the endpoints in a model to capture the coordinates? 

Аватар
Отменить
Лучший ответ

Hi,

To get the user location you can use the following code,

country_code_val = request.session['geoip'].get('country_code')
if country_code:
country_id = request.env['res.country'].search([('code', '=', country_code)], limit=1).id
 
 


You can add a new field and can save this to that field, Thanks

Аватар
Отменить

What would a "request" be in this context?

Related Posts Ответы Просмотры Активность
1
сент. 22
5239
3
июн. 25
889
1
дек. 24
4026
0
дек. 24
873
2
июл. 24
2150