summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/product_product.py
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-06-15 15:47:05 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-06-15 15:47:05 +0700
commit55c67c71b04fce80c635b3a58d91c8bcb02e17c8 (patch)
treeed8833b969800e36b887b4134c14dab89d3b91c7 /indoteknik_api/models/product_product.py
parent1f2995a85428ac4335123bd33d48ae17d3c9f36f (diff)
parent24649f8e939484759ef34e5e68f251d951f63c02 (diff)
Merge commit '24649f8e939484759ef34e5e68f251d951f63c02'
Conflicts: indoteknik_custom/__manifest__.py indoteknik_custom/security/ir.model.access.csv
Diffstat (limited to 'indoteknik_api/models/product_product.py')
-rw-r--r--indoteknik_api/models/product_product.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index 49ea7804..14fe68cb 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -54,6 +54,13 @@ class ProductProduct(models.Model):
if price[discount_key] > 0: discount_percentage = price[discount_key]
if price[price_key] > 0: price_discount = price[price_key]
+ flashsale = product_product._get_flashsale_price()
+ flashsale_price = flashsale['flashsale_price']
+ flashsale_discount = flashsale['flashsale_discount']
+ if flashsale_price > 0 and flashsale_price < price_discount:
+ price_discount = flashsale_price
+ discount_percentage = flashsale_discount
+
product_template = product_product.product_tmpl_id
data = {
'id': product_product.id,
@@ -139,7 +146,7 @@ class ProductProduct(models.Model):
default_divide_tax = float(1.11)
price_after_disc = self._get_website_price_after_disc()
res = price_after_disc / default_divide_tax
- res = math.floor(res)
+ res = math.ceil(res)
return res
def _get_website_price_after_disc(self):