summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/voucher.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/voucher.py')
-rw-r--r--indoteknik_custom/models/voucher.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/voucher.py b/indoteknik_custom/models/voucher.py
index 66c50c24..588e9ac5 100644
--- a/indoteknik_custom/models/voucher.py
+++ b/indoteknik_custom/models/voucher.py
@@ -55,6 +55,9 @@ class Voucher(models.Model):
('brand', "Selected product brand"),
])
count_order = fields.Integer(string='Count Order', compute='_compute_count_order')
+ show_on_email = fields.Selection([
+ ('user_activation', 'User Activation')
+ ], 'Show on Email')
@api.constrains('description')
def _check_description_length(self):
@@ -219,7 +222,7 @@ class Voucher(models.Model):
tnc.append(f'<li>Voucher berlaku {self._res_remaining_time()} lagi</li>')
tnc.append(f'<li>Voucher tidak bisa digunakan apabila terdapat produk flash sale</li>')
if len(self.voucher_line) > 0:
- brand_names = ', '.join([x.manufacture_id.x_name for x in self.voucher_line])
+ brand_names = ', '.join([x.manufacture_id.x_name or '' for x in self.voucher_line])
tnc.append(f'<li>Voucher berlaku untuk produk dari brand {brand_names}</li>')
tnc.append(self.generate_detail_tnc())
tnc.append('</ol>')