summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_api/models/product_product.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index a8502dbc..edf95a58 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -63,6 +63,8 @@ class ProductProduct(models.Model):
price_discount = flashsale_price
discount_percentage = flashsale_discount
+ stock = product_product.qty_stock_vendor
+ stock = stock if stock > 0 else 1
product_template = product_product.product_tmpl_id
data = {
'id': product_product.id,
@@ -78,7 +80,7 @@ class ProductProduct(models.Model):
'discount_percentage': discount_percentage,
'price_discount': price_discount
},
- 'stock': product_product.qty_stock_vendor,
+ 'stock': stock,
'weight': product_product.weight,
'attributes': [x.name for x in product_product.product_template_attribute_value_ids],
'manufacture' : self.api_manufacture(product_product)