Hi friends,
Im using openerp v 6.1.I have to get the ip address and need to store it in databse based on user login. How can we achieve this? Please help me in this situation.Thanks in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi friends,
Im using openerp v 6.1.I have to get the ip address and need to store it in databse based on user login. How can we achieve this? Please help me in this situation.Thanks in advance.
You can add import:
from openerp.http import request
And then create a method which gets the IP through the environ:
def _get_ipaddress(self, cr, uid, context=None):
return request.httprequest.environ['REMOTE_ADDR']
Another V6.1 user that reported he got it working was through this:https://www.odoo.com/forum/help-1/question/how-to-get-user-ip-address-25735#answer_38757
Similar questions (where my answer is based on):
https://www.odoo.com/forum/help-1/question/how-to-get-openerp-client-ip-74427
https://www.odoo.com/forum/help-1/question/how-to-get-user-ip-address-25735
https://www.odoo.com/nl_NL/forum/help-1/question/openerp-get-user-ip-address-76073
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 3 15
|
5381 | ||
|
0
thg 3 15
|
4545 | ||
|
9
thg 7 15
|
15136 | ||
OpenERP get User IP Address
Đã xử lý
|
|
7
thg 2 24
|
12264 | |
|
0
thg 11 17
|
4066 |
by request.environ: https://learnopenerp.blogspot.com/2020/07/get-web-httprequest-in-odoo.html