Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hr_attendance_leave_report/models/hr_attendance_leave.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ def _update_attendance_leave_info(self, employee, work_date):
and attendance_leave
and (vals.get("hours_to_work") != 0 or vals.get("worked_hours") != 0)
):
attendance_leave.write(vals)
attendance_leave.with_context(lang=self.env.user.lang).write(vals)
if (
contract
and not attendance_leave
and (vals.get("hours_to_work") != 0 or vals.get("worked_hours") != 0)
):
vals["work_day"] = work_date
vals["employee_id"] = employee.id
attendance_leave.create(vals)
attendance_leave.with_context(lang=self.env.user.lang).create(vals)

def _initialize_vals(self, employee, work_date):
hours_to_work, contract = self._catch_hours_of_work_schedule(
Expand Down