Skip to content

Commit

Permalink
[FIX] hr_holidays: compute number of days
Browse files Browse the repository at this point in the history
- Create a user with only "Employee" as only right
- Create a leave

An access error occurs.

opw-726049
  • Loading branch information
nim-odoo committed Mar 28, 2017
1 parent 099081a commit 0dbc8b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/hr_holidays/models/hr_holidays.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _get_number_of_days(self, date_from, date_to, employee_id):

if employee_id:
employee = self.env['hr.employee'].browse(employee_id)
resource = employee.resource_id
resource = employee.resource_id.sudo()
if resource and resource.calendar_id:
hours = resource.calendar_id.get_working_hours(from_dt, to_dt, resource_id=resource.id, compute_leaves=True)
uom_hour = resource.calendar_id.uom_id
Expand Down

0 comments on commit 0dbc8b0

Please sign in to comment.