Skip to content

Commit

Permalink
[FIX] sale_timesheet_line_exclude: recompute so line when changing ex…
Browse files Browse the repository at this point in the history
…clude flag

While the test does not reveal this, without this change, clicking on the
checkbox in the timesheet list view
does not reset the so line.
  • Loading branch information
sbidoul committed Oct 9, 2024
1 parent fff331b commit ca22ac4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sale_timesheet_line_exclude/models/account_analytic_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def _compute_timesheet_invoice_type(self):
return res

@api.depends("exclude_from_sale_order")
def _compute_so_line_on_exclude(self):
self._compute_so_line()
def _compute_so_line(self):
return super()._compute_so_line()

def _timesheet_determine_sale_line(self):
self.ensure_one()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ def test_write_exclude_from_sale_order(self):
"account_id": self.project.analytic_account_id.id,
}
)
self.assertTrue(timesheet.so_line)
timesheet.write({"exclude_from_sale_order": True})
self.assertFalse(timesheet.so_line)

self.assertEqual(timesheet.timesheet_invoice_type, "non_billable")
self.assertEqual(self.sale_order_line.qty_delivered, 0)
Expand Down

0 comments on commit ca22ac4

Please sign in to comment.