I have 5 Level approvals in my custom module function.I define inverse attribute for my state field and based on changing state i write function in that inverse function.When i calling self.env.user from that inverse function i will always shows as Super admin user even i log in different user.Please help me to fix this
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Make sure you are not calling the methods inside "sudo".
e.g. If you are calling a method 'confirm_order' though sudo, the 'confirm_method' is going to see env.user as SUPERUSER.
Thank you so much..I was stucked almost 1 week for finding this issue.
Hi,
if you need id, get it like self.env.user.id
could you check self.env.user.name to check if you logged in as user A?
I checked that,but i always get Super user
This usually happens when the model is created as superuser using sudo() method. First the non admin user have the proper access rights to create records in that model.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Jan 24
|
1782 | ||
|
2
Jul 24
|
13919 | ||
|
2
Sep 23
|
6673 | ||
|
2
May 23
|
1560 | ||
|
1
Apr 23
|
1749 |