Skip to Content
मेन्यू
This question has been flagged
2 Replies
10176 Views

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 .

Avatar
Discard
Best Answer

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

Avatar
Discard
Best Answer

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

Avatar
Discard

What would a "request" be in this context?

Related Posts Replies Views Activity
1
सित॰ 22
5230
3
जून 25
856
1
दिस॰ 24
4022
0
दिस॰ 24
867
2
जुल॰ 24
2081