diff --git a/addons/sale/models/sale_order.py b/addons/sale/models/sale_order.py index 6a9148dd2f8..af0b961847c 100644 --- a/addons/sale/models/sale_order.py +++ b/addons/sale/models/sale_order.py @@ -593,7 +593,11 @@ class SaleOrder(models.Model): def _compute_is_expired(self): today = fields.Date.today() for order in self: - order.is_expired = order.state == 'sent' and order.validity_date and order.validity_date < today + order.is_expired = ( + order.state in ('draft', 'sent') + and order.validity_date + and order.validity_date < today + ) @api.depends('company_id', 'fiscal_position_id') def _compute_tax_country_id(self):