I want to identify certain machines so that no matter which user is logged in some rules will apply to them. Is it possible?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
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
How do I get the request object?
above code is return inside the controller. You can check the modules in the given link, that will give you more info
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.
`pip install httpagentparser` should solve your issue
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
2
mar 24
|
11319 | ||
Dynamically created filter for tree view
Rozwiązane
|
|
2
sie 21
|
13531 | |
|
1
gru 19
|
5383 | ||
|
0
wrz 17
|
3535 | ||
|
0
sie 17
|
2892 |
You can extract useful info from httprequest: https://learnopenerp.blogspot.com/2020/07/get-web-httprequest-in-odoo.html