Skip to content

Commit

Permalink
[FIX] hr_timesheet_sheet: deal with time off line
Browse files Browse the repository at this point in the history
Fixes inability to add lines to timesheets that containstime off lines,
managed from project_timesheet_holidays.

Fixes OCA#711
  • Loading branch information
maisim authored and Borruso committed Nov 26, 2024
1 parent 89d9e50 commit 42b0aad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hr_timesheet_sheet/models/hr_timesheet_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,8 @@ def add_line(self):
if existing_unique_ids:
self.delete_empty_lines(False)
if frozenset(new_line_unique_id.items()) not in existing_unique_ids:
self.timesheet_ids |= self.env["account.analytic.line"]._sheet_create(
values
)
new_line = self.env["account.analytic.line"]._sheet_create(values)
self.write({"timesheet_ids": [(4, new_line.id)]})

def link_timesheets_to_sheet(self, timesheets):
self.ensure_one()
Expand Down

0 comments on commit 42b0aad

Please sign in to comment.