Skip to content

Commit

Permalink
Fix Singleton Exception (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
agent-z28 authored and alexis-via committed Jan 31, 2024
1 parent 0569b08 commit 262b60a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sale_start_end_dates/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _compute_start_date(self):
line.start_date = order.default_start_date
elif line.start_date and not line.product_id.must_have_dates:
line.start_date = False
elif line.end_date and line.start_date and line.start_date > self.end_date:
elif line.end_date and line.start_date and line.start_date > line.end_date:
line.start_date = line.end_date

@api.depends("start_date", "product_id")
Expand All @@ -181,5 +181,5 @@ def _compute_end_date(self):
line.end_date = order.default_end_date
elif line.end_date and not line.product_id.must_have_dates:
line.end_date = False
elif line.end_date and line.start_date and line.start_date > self.end_date:
elif line.end_date and line.start_date and line.start_date > line.end_date:
line.end_date = line.start_date

0 comments on commit 262b60a

Please sign in to comment.