Files
damr 2cfb25c033 [FIX] hr_timesheet: make portal view readonly for ts
Currently, there is an access right problem concerning timesheet. The
module mrp gives write access to portal user on analytic line, but it is not
something we want for the project app.

step to reproduce:
- install hr_timesheet on a saas-16.3 db
- go to project app, open office design
- select any task, and add a subtask to it
- go the the view form of the subtask
- create a new timesheet for this subtask
- go back to the view form of the parent task
a button 'subtask timesheet' is now visible
- share the project in edit mode with a portal user
- connect with that portal user
- open the office design project
- go to the view form of the parent task and click on the button
- the user is redirected to a view tree with the timesheet of the
subtask
this view tree is editable

Source of the problem:
in the mrp module, the access rights of the analytic line is overwritten
to give write access to it to portal user.
Soluce:
We have to make the view in readonly mode for timesheet when the
connected user is a portal one. Unfortunately, it is not 100% possible
because setting the field to readonly still gives the user the
opportunity to click on those fields (which triggers access errors). So
we have to create new views and specifically open those views when the
user is a portal one.

affected version: saas-16.3 - master
task - 3751315

closes odoo/odoo#160959

X-original-commit: 7b733f118f60ff98d9f82c69453187d70e6bece0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-04-10 08:17:49 +00:00
..