Odoo Help

0

0
4 Answers
1
Avatar

Niyas Raphy

--Niyas Raphy--
24342
| 7 7 11
Wayanad, India
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123

Happy to help :)

Niyas Raphy
10.08.17, 06:31

Hi,

You can get the logged in machine details using the following code.

import httpagentparser

agent = request.httprequest.environ.get('HTTP_USER_AGENT')
agent_details = httpagentparser.detect(agent)
user_os = agent_details['os']['name']
browser_name = agent_details['browser']['name']
ip_address = request.httprequest.environ['REMOTE_ADDR']

From the above code you will get the IP address of the logged system, Browser and OS details.

You can also check with this community modules, but it is not in v7.

https://www.odoo.com/apps/modules/10.0/login_user_detail/

https://www.odoo.com/apps/modules/10.0/user_login_alert/

Thanks

2 Comments
dohn_joe
10.08.17, 07:29

How do I get the request object?

Niyas Raphy
10.08.17, 07:36

above code is return inside the controller. You can check the modules in the given link, that will give you more info

0
Shivendra Thakur
13.08.17, 05:49

User login alert gives error as "Unable to install module "user_login_alert" because an external dependency is not met: No module named httpagentparser" Please assist.

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now