summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-02-19 15:02:35 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-02-19 15:02:35 +0700
commit38f8ddd9aaaad58c8d7ea27235cd109ba288693d (patch)
treeb08dd8863e9485503ef6dc42598140b438ca3982 /indoteknik_custom/models/solr
parent66901cd03a1494e6c84893e14083dcd1fbe737a5 (diff)
<iman> change logic solr is_in_bu from available to qty_free_bandengan
Diffstat (limited to 'indoteknik_custom/models/solr')
-rw-r--r--indoteknik_custom/models/solr/product_template.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py
index 87e8370f..8afff6e3 100644
--- a/indoteknik_custom/models/solr/product_template.py
+++ b/indoteknik_custom/models/solr/product_template.py
@@ -76,8 +76,11 @@ class ProductTemplate(models.Model):
('product_id', 'in', template.product_variant_ids.ids),
('location_id', 'in', target_locations),
])
-
- is_in_bu = any(quant.available_quantity > 0 for quant in stock_quant)
+ is_in_bu = False
+ for quant in stock_quant:
+ if quant.product_id.qty_free_bandengan > 0:
+ is_in_bu = True
+ break
cleaned_desc = BeautifulSoup(template.website_description or '', "html.parser").get_text()
website_description = template.website_description if cleaned_desc else ''