コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
10182 ビュー

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?

関連投稿 返信 ビュー 活動
1
9月 22
5233
3
6月 25
863
1
12月 24
4023
0
12月 24
868
2
7月 24
2085