diff --git a/sale_start_end_dates/models/sale_order.py b/sale_start_end_dates/models/sale_order.py index 0acd7cdacd6..172e412d81d 100644 --- a/sale_start_end_dates/models/sale_order.py +++ b/sale_start_end_dates/models/sale_order.py @@ -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") @@ -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