[FIX] coupon: allow overridden method to be called

Due to some changes in the ORM, the previous implementation doesn't allow the override of a method to be called.

closes odoo/odoo#83595

X-original-commit: b1af44bad3a87a92f8726ed69eadffdbe4ac7c0b
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
This commit is contained in:
Jacky (trj)
2022-01-28 18:58:44 +00:00
parent 993acf8761
commit 0e8e71aa9e
+1 -1
View File
@@ -24,7 +24,7 @@ class Coupon(models.Model):
"""
return str(random.getrandbits(64))
code = fields.Char(default=_generate_code, required=True, readonly=True)
code = fields.Char(default=lambda self: self._generate_code(), required=True, readonly=True)
expiration_date = fields.Date('Expiration Date', compute='_compute_expiration_date')
state = fields.Selection([
('reserved', 'Pending'),