diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-12-16 08:27:17 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-12-16 08:27:17 +0700 |
| commit | 7cbb05cfb2de23562c153156448d0beadbeaf742 (patch) | |
| tree | 4fc71d8a313db48b2b31dd3f43c873ae7d2dc7cd /indoteknik_api | |
| parent | 335d724a7f359223138de74bf682cfc3530b5ea7 (diff) | |
<iman> perbaiki code flash sale
Diffstat (limited to 'indoteknik_api')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/flash_sale.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/flash_sale.py b/indoteknik_api/controllers/api_v1/flash_sale.py index 00b1f2e0..6c4ad8c0 100644 --- a/indoteknik_api/controllers/api_v1/flash_sale.py +++ b/indoteknik_api/controllers/api_v1/flash_sale.py @@ -20,6 +20,7 @@ class FlashSale(controller.Controller): query = [ ('pricelist_id', '=', pricelist.id) ] + formatted_end_date = pricelist.end_date.strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z' if pricelist.end_date else None data.append({ 'pricelist_id': pricelist.id, 'option': pricelist.flashsale_option, @@ -29,6 +30,7 @@ class FlashSale(controller.Controller): 'banner_mobile': request.env['ir.attachment'].api_image('product.pricelist', 'banner_mobile', pricelist.id), 'banner_top': request.env['ir.attachment'].api_image('product.pricelist', 'banner_top', pricelist.id), 'duration': pricelist._remaining_time_in_second(), + 'end_date': formatted_end_date, 'product_total': request.env['product.pricelist.item'].search_count(query), }) return self.response(data) |
