diff --git a/addons/pos_loyalty/models/pos_config.py b/addons/pos_loyalty/models/pos_config.py index 4f98e985ec7..4ccb38a6598 100644 --- a/addons/pos_loyalty/models/pos_config.py +++ b/addons/pos_loyalty/models/pos_config.py @@ -82,7 +82,7 @@ class PosConfig(models.Model): } check_date = fields.Date.from_string(creation_date[:11]) if (coupon.expiration_date and coupon.expiration_date < check_date) or\ - (coupon.program_id.date_to and coupon.program_id.date_to <= fields.Date.context_today(self)) or\ + (coupon.program_id.date_to and coupon.program_id.date_to < fields.Date.context_today(self)) or\ (coupon.program_id.limit_usage and coupon.program_id.total_order_count >= coupon.program_id.max_usage): return { 'successful': False, diff --git a/addons/sale_loyalty/models/sale_order.py b/addons/sale_loyalty/models/sale_order.py index 5bfff6cab57..1c391bb661b 100644 --- a/addons/sale_loyalty/models/sale_order.py +++ b/addons/sale_loyalty/models/sale_order.py @@ -956,7 +956,7 @@ class SaleOrder(models.Model): if not program or not program.active: return {'error': _('This code is invalid (%s).', code), 'not_found': True} elif (program.limit_usage and program.total_order_count >= program.max_usage) or\ - (program.date_to and program.date_to <= fields.Date.context_today(self)): + (program.date_to and program.date_to < fields.Date.context_today(self)): return {'error': _('This code is expired (%s).', code)} # Rule will count the next time the points are updated