[IMP] hr_payroll : Clean access rules
=> Officer can see their own and their subordinates payslip. => Manager can see everyone's payslip.
This commit is contained in:
@@ -19,5 +19,19 @@
|
||||
<field name="groups_id" eval="[(4,ref('hr_payroll.group_hr_payroll_manager'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payroll_rule_officer" model="ir.rule">
|
||||
<field name="name">Officer and subordinates Payslip</field>
|
||||
<field name="model_id" ref="model_hr_payslip"/>
|
||||
<field name="domain_force">['|','|', ('employee_id.user_id', '=', user.id), ('employee_id.department_id', '=', False), ('employee_id.department_id.manager_id.user_id', '=', user.id)]</field>
|
||||
<field name="groups" eval="[(4, ref('hr_payroll.group_hr_payroll_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="hr_payslip_rule_manager" model="ir.rule">
|
||||
<field name="name">All Payslip</field>
|
||||
<field name="model_id" ref="model_hr_payslip"/>
|
||||
<field name="domain_force">[(1,'=',1)]</field>
|
||||
<field name="groups" eval="[(4, ref('hr_payroll.group_hr_payroll_manager'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -5,7 +5,7 @@ access_hr_salary_rule_category,hr.salary.rule.category,model_hr_salary_rule_cate
|
||||
access_hr_payslip,hr.payslip,model_hr_payslip,hr_payroll.group_hr_payroll_user,1,1,1,1
|
||||
access_hr_payslip_line,hr.payslip.line,model_hr_payslip_line,hr_payroll.group_hr_payroll_user,1,1,1,1
|
||||
access_hr_payslip_input_user,hr.payslip.input.user,model_hr_payslip_input,hr_payroll.group_hr_payroll_user,1,1,1,1
|
||||
access_hr_payslip_worked_days ,hr.payslip.worked_days,model_hr_payslip_worked_days,hr_payroll.group_hr_payroll_manager,1,1,1,1
|
||||
access_hr_payslip_worked_days_officer,hr.payslip.worked_days.officer,model_hr_payslip_worked_days,hr_payroll.group_hr_payroll_user,1,1,1,1
|
||||
access_hr_payslip_run,hr.payslip.run,model_hr_payslip_run,hr_payroll.group_hr_payroll_manager,1,1,1,1
|
||||
access_hr_rule_input,hr.rule.input,model_hr_rule_input,hr_payroll.group_hr_payroll_manager,1,1,1,1
|
||||
access_hr_rule_input_officer,hr.rule.input.office,model_hr_rule_input,hr_payroll.group_hr_payroll_user,1,1,1,1
|
||||
access_hr_salary_rule_user,hr.salary.rule.user,model_hr_salary_rule,hr_payroll.group_hr_payroll_user,1,1,1,1
|
||||
|
||||
|
Reference in New Issue
Block a user