Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to get ip address of login user?

By
vadivel
on 2/20/15, 2:26 AM 1,383 views

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.

2

Yenthe

--Yenthe--
6686
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 2/20/15, 2:34 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/20/15, 2:26 AM
Seen: 1383 times
Last updated: 3/16/15, 8:10 AM