how to make double validation in leaves management in HR module, I want two validates one for HR officer and the other is for Manager, I checked apply double validation from configuration but I found that the HR officer apply both validates but I need one for HR officer and the other for manager
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
This is because the HR officer and manager have the access rights to approve. You didn't mention the version here. If it's in Odoo 11, we can select the reporting 1 and 2 in employee form. If you need to restrict the validation by an officer twice, just make a record rule in settings for leave according to the manager and coach in HR Employee form.
For Odoo 10,
1. Add attrs [invisible] attribute for approving button.
2. Add a flag field in the model to check the user is allowed to see approve button.
3. The flag should be a compute button and compare this flag in the filter domain of attrs.
You can check the manager or coach id's user is logged in or not in compute function of the flag.
If you need to achieve this through security rule then you have to add domain in domain filter filed of record rule objects like state in validate and also check the coach or manager is logged in by user.id
example domain :-
For Officers. select Object in record rule for Leaves and fill this domain. change this domain if any additions needed(for your custom work).
[('state', '=', 'confirm'), '|', ('employee_id.parent_id.user_id.id', '=', user.id), ('employee_id.user_id.id', '=', user.id)]
Thanks alot
This same scenario will apply for odoo 13?
the version is odoo 10 ? could you please tell me what should I do
please check my updated answer.
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 20
|
4607 | ||
|
1
Sep 19
|
3847 | ||
|
2
Jul 25
|
4393 | ||
|
3
Mar 25
|
3312 | ||
|
2
Dec 24
|
7595 |