summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/voucher.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-11-25 02:42:37 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-11-25 02:42:37 +0000
commit4dcd1e3e1a3e4dced5a2d0d89d2fd4ee3e1fe7d3 (patch)
tree3e15c66065c81eead3fb40c9f87e3f2c269e20f2 /indoteknik_custom/models/voucher.py
parent2aee5a44abbe36961dfe23cc3d656aa48e11e0f9 (diff)
parent693e78afa8b9b4df99f417392b42bff12ea41f9e (diff)
Merged in production (pull request #132)
Production
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>')