Skip to content
Permalink
Browse files

[FIX] project_timesheet_holidays: Allow HR Officers to generate times…

…heets

Purpose
=======

Steps to reproduce:

- Log in as admin
- Make demo user 'Leaves Manager' in Settings/Users.
- Log out and log in again as demo
- Go to Leaves/Leaves to approve/Leaves
- Select Pieter Parker's leave request and click 'Approve'.

Current behavior:
Access error occurs due to security restrictions on Analytic Line,
Operation: write

Expected behavior:
The leave request should be approved as the Leaves Manager should have
permission to approve leave.

Closes #25114

closes #42794

X-original-commit: 78c984b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
  • Loading branch information
tivisse committed Jan 6, 2020
1 parent d6a36e2 commit 0755be97f916e6fa9fa823de714e1108db26bf5d
Showing with 1 addition and 1 deletion.
  1. +1 −1 addons/project_timesheet_holidays/models/hr_holidays.py
@@ -58,7 +58,7 @@ def _validate_leave_request(self):

work_hours_data = [item for item in holiday.employee_id.iter_work_hours_count(fields.Datetime.from_string(holiday.date_from), fields.Datetime.from_string(holiday.date_to))]
for index, (day_date, work_hours_count) in enumerate(work_hours_data):
self.env['account.analytic.line'].create({
self.env['account.analytic.line'].sudo().create({
'name': "%s (%s/%s)" % (holiday.name or '', index + 1, len(work_hours_data)),
'project_id': holiday_project.id,
'task_id': holiday_task.id,

0 comments on commit 0755be9

Please sign in to comment.
You can’t perform that action at this time.