Skip to content

Commit

Permalink
[FIX] payroll - revert change of leave hours/days to negative in OCA#27
Browse files Browse the repository at this point in the history
  • Loading branch information
mtelahun committed Jun 17, 2022
1 parent 270f8c5 commit 21ecf36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions payroll/models/hr_payslip.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,14 @@ def get_worked_day_lines(self, contracts, date_from, date_to):
"contract_id": contract.id,
},
)
current_leave_struct["number_of_hours"] -= hours
current_leave_struct["number_of_hours"] += hours
work_hours = calendar.get_work_hours_count(
tz.localize(datetime.combine(day, time.min)),
tz.localize(datetime.combine(day, time.max)),
compute_leaves=False,
)
if work_hours:
current_leave_struct["number_of_days"] -= hours / work_hours
current_leave_struct["number_of_days"] += hours / work_hours

# compute worked days
work_data = contract.employee_id._get_work_days_data(
Expand Down

0 comments on commit 21ecf36

Please sign in to comment.