summaryrefslogtreecommitdiff
path: root/indoteknik_api/models
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-08-04 03:59:33 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-08-04 03:59:33 +0000
commit6d17228cd6c789fe4460e28807d5b39fb1bbe9b7 (patch)
treea4c961062c026e1005ebdc82547903c3f30c0a06 /indoteknik_api/models
parentcc182dd9963fb8985661ca1b64a53e7f11f095c5 (diff)
parentbcc35009da39e9ee8b5e181006d3690316b83c59 (diff)
Merged in development (pull request #82)
Development
Diffstat (limited to 'indoteknik_api/models')
-rw-r--r--indoteknik_api/models/product_template.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_template.py b/indoteknik_api/models/product_template.py
index 68ab79c2..fb77769f 100644
--- a/indoteknik_api/models/product_template.py
+++ b/indoteknik_api/models/product_template.py
@@ -70,8 +70,12 @@ class ProductTemplate(models.Model):
for variant in variants:
if variant["price"]["price_discount"] < lowest_price["price_discount"]:
lowest_price = variant['price']
-
+ template_pricelist = product_template._get_active_flash_sale()
data_with_detail = {
+ 'flash_sale': {
+ 'remaining_time': template_pricelist._remaining_time_in_second() if template_pricelist else 0,
+ 'tag': template_pricelist.flashsale_tag if template_pricelist else None
+ },
'lowest_price': lowest_price,
'image': self.env['ir.attachment'].api_image('product.template', 'image_512', product_template.id),
'display_name': product_template.display_name,