[FIX] hr_timesheet : allow project managers to handle timesheets

Steps to reproduce:
- Install project and timesheet
- Create a project with settings "invited employees only"
- Create a user with administrator project right (and non admin
rights for timesheet)
- Create a task in the new project
- Try to generate a timesheet on the task with the new user (the
user has to not follow the task)

Current behavior:
This generate an access error due to not respecting some rules

Expected behavior:
The timesheet is created

Explanation:
The project admin should be able to handle any timesheet that is
linked to a project to do so we add its groupto the rule that gives
access to the model analytic.model_account_analytic_line if there
is a project_id.

opw-2861042

closes odoo/odoo#94102

X-original-commit: 70a0ad280e0c8a62f24d6943be082298fa98e443
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit is contained in:
mafo-odoo
2022-06-20 20:45:29 +02:00
parent a4c843784b
commit 652d235c8d
@@ -79,7 +79,7 @@
<field name="name">account.analytic.line.timesheet.manager</field>
<field name="model_id" ref="analytic.model_account_analytic_line"/>
<field name="domain_force">[('project_id', '!=', False)]</field>
<field name="groups" eval="[(4, ref('group_timesheet_manager'))]"/>
<field name="groups" eval="[(4, ref('group_timesheet_manager')), (4, ref('project.group_project_manager'))]"/>
</record>
<record id="project.group_project_manager" model="res.groups">