Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
10321 Vizualizări

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 .

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează

What would a "request" be in this context?

Related Posts Răspunsuri Vizualizări Activitate
1
sept. 22
5373
3
iun. 25
1147
1
dec. 24
4204
0
dec. 24
1029
2
iul. 24
2482