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

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

アバター
破棄
関連投稿 返信 ビュー 活動
2
3月 15
5337
0
3月 15
4503
9
7月 15
15110
7
2月 24
12241
0
11月 17
4034