Skip to content
Snippets Groups Projects
Commit 2fa050b3 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] sale_coupon: expiration date


MAke sure to always set the expiration date of a coupon.

opw-2151284

closes odoo/odoo#41470

X-original-commit: 2e5a6699
Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 33edd635
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ class SaleCoupon(models.Model):
]
def _compute_expiration_date(self):
self.expiration_date = 0
for coupon in self.filtered(lambda x: x.program_id.validity_duration > 0):
coupon.expiration_date = (coupon.create_date + relativedelta(days=coupon.program_id.validity_duration)).date()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment