跳至内容
菜单
此问题已终结
2 回复
10196 查看

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
5239
3
6月 25
890
1
12月 24
4027
0
12月 24
874
2
7月 24
2153