I tried to create a user from the python button method. I added 'active': false, to make the user inactive. (Later I will make the user active after getting approval from managers.)
But the system is not allowing me to create a user since I added active as false.
The error message is below,
Is there any solution for 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
Hello
Created a users using below python code and it created archived user. After that, I unarchive the user using action menu and it worked.
self.env['res.users'].create({
'name': 'Mike Organizer',
'login': 'mike@organizer.com',
'active': False,
})
Thanks & Regards,
CandidRoot Solutions Pvt. Ltd.
Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat 380015
Never faced this issue, but you could create them without any powers and then add them in a group which gives them the according powers they would need. Would that work?
You could also make it the other way around, create them as part of a group which has no powers and then just remove them from that group.
At last, one last option would be to create the user as active, and right after that update it to make it inactive.
All of that aside, I do not know why you can't create them as inactive. I guess you tried to create them as active and it worked.
Hi,
I create a user from python code not from UI.
I didn't add any group or assign any group for the user.
If I add active as True means a user will be created. But in my case, I want to make the user archived by default after creating it. when we need we will make the user active.
Is there any other solution for creating archived users from the py method?
Yes, I'm aware that you are trying it from python. Would any of the solutions above work for you? For example, the last one, creating and then making the user inactive (via python) would work?
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 | |
---|---|---|---|---|
|
2
Feb 24
|
1800 | ||
|
1
Nov 24
|
2417 | ||
|
0
Oct 21
|
1640 | ||
|
1
Nov 24
|
1482 | ||
|
1
Nov 24
|
1186 |