summaryrefslogtreecommitdiff
path: root/indoteknik_api/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-04-29 10:00:15 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-04-29 10:00:15 +0700
commit783b674e04dd123a5233fd01896925c73aa8143c (patch)
treea0b5dea1b38eb0141180396d621a76381a337f38 /indoteknik_api/models
parentbac1744ce4e27d796fd2b52f5fbcd3d5cdabdc75 (diff)
check product on bom, view stock picking po and fix bug api flashsale header
Diffstat (limited to 'indoteknik_api/models')
-rw-r--r--indoteknik_api/models/product_pricelist.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/indoteknik_api/models/product_pricelist.py b/indoteknik_api/models/product_pricelist.py
index 6e88517c..2e825740 100644
--- a/indoteknik_api/models/product_pricelist.py
+++ b/indoteknik_api/models/product_pricelist.py
@@ -95,15 +95,20 @@ class ProductPricelist(models.Model):
], limit=1, order='start_date asc')
return pricelist
- def get_is_show_program_flash_sale(self):
+ def get_is_show_program_flash_sale(self, is_show_program):
"""
Check whether have active flash sale in range of date
@return: returns pricelist: object
"""
+
+ if is_show_program == 'true':
+ is_show_program = True
+ else:
+ is_show_program = False
current_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
pricelist = self.search([
('is_flash_sale', '=', True),
- ('is_show_program', '=', True),
+ ('is_show_program', '=', is_show_program),
('start_date', '<=', current_time),
('end_date', '>=', current_time)
], order='start_date asc')