summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/website_user_cart.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-11-12 09:49:29 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-11-12 09:49:29 +0700
commit9110fb5d93fc7bf9513a0705a22764aca711be26 (patch)
treeaa51b069813001494dbd98bd7c98d444e820bd66 /indoteknik_custom/models/website_user_cart.py
parent200d9ba97ba86f759b3d804c253430230c353fe0 (diff)
parent38c6551a94098370e060e45739dc4c8ae923c48e (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/website_user_cart.py')
-rw-r--r--indoteknik_custom/models/website_user_cart.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py
index 6cb282f8..494f32f3 100644
--- a/indoteknik_custom/models/website_user_cart.py
+++ b/indoteknik_custom/models/website_user_cart.py
@@ -65,9 +65,11 @@ class WebsiteUserCart(models.Model):
if stock_quant:
res['is_in_bu'] = True
res['on_hand_qty'] = sum(stock_quant.mapped('quantity'))
+ res['available_quantity'] = stock_quant.available_quantity
else:
res['is_in_bu'] = False
res['on_hand_qty'] = 0
+ res['available_quantity'] = 0
flashsales = self.product_id._get_active_flash_sale()
res['has_flashsale'] = True if len(flashsales) > 0 else False