Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
10191 Tampilan

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
Buang
Jawaban Terbai

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

Avatar
Buang
Jawaban Terbai

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
Buang

What would a "request" be in this context?

Post Terkait Replies Tampilan Aktivitas
1
Sep 22
5236
3
Jun 25
885
1
Des 24
4026
0
Des 24
873
2
Jul 24
2129