Files
odoo_source/addons/hr_timesheet/tests
Hugo Carlier (Huca) 561775fda9 [FIX] hr_timesheet: avoid access error in project sharing
Steps
=====
- Install hr_timesheet
- Create a project shared (in edition) with a portal user
- Creata a task with a subtask and log timesheets for the subtask
- As a portal user open the parent task form
- Go in the timesheet tab
- Click on the button "Sub-tasks Hours/Days Spent" at the bottom of the
  page

Issue
=====
An access error appears for an uom.uom record.

Cause
=====
Portal users have no access to uom.uom records. The method
_apply_timesheet_label uses this model to determine if the time spent
needs to be displayed with an 'hours' or a 'days' label. This raises a
traceback when it is called by a portal user.

Fix
===
The method _apply_timesheet_label is called as sudo, following the fix
that was already done in project sharing (see odoo/odoo#73341).

task-3527521

closes odoo/odoo#139125

X-original-commit: 01b1cf07bc1fb618d34065271cdc07fce561337f
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-19 10:45:52 +00:00
..