diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-10-10 02:21:14 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-10-10 02:21:14 +0000 |
| commit | f83fe58aafefefe98ab127e3434b7261e2ecfc18 (patch) | |
| tree | a2648fa0671cb04db2f089d735241bfc5ead7462 | |
| parent | bf80d91dd74549db76edc0c3df3221bb7afc7564 (diff) | |
| parent | 698cb0618c8bc90a02aeaa5ceb35818b26c71324 (diff) | |
Merged in iman/update-readyStock (pull request #238)
<iman> update ready stock
| -rw-r--r-- | indoteknik_custom/models/solr/product_product.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/models/solr/product_template.py | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py index df20cc4b..7c10a910 100644 --- a/indoteknik_custom/models/solr/product_product.py +++ b/indoteknik_custom/models/solr/product_product.py @@ -52,10 +52,9 @@ class ProductProduct(models.Model): stock_quant = self.env['stock.quant'].search([ ('product_id', 'in', variant.product_variant_ids.ids), ('location_id', 'in', target_locations), - ('quantity', '>', 0) ]) - is_in_bu = bool(stock_quant) + is_in_bu = any(quant.available_quantity > 0 for quant in stock_quant) document = solr_model.get_doc('variants', variant.id) diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py index 70246ba3..029e0956 100644 --- a/indoteknik_custom/models/solr/product_template.py +++ b/indoteknik_custom/models/solr/product_template.py @@ -75,10 +75,9 @@ class ProductTemplate(models.Model): stock_quant = self.env['stock.quant'].search([ ('product_id', 'in', template.product_variant_ids.ids), ('location_id', 'in', target_locations), - ('quantity', '>', 0) ]) - is_in_bu = bool(stock_quant) + is_in_bu = any(quant.available_quantity > 0 for quant in stock_quant) cleaned_desc = BeautifulSoup(template.website_description or '', "html.parser").get_text() website_description = template.website_description if cleaned_desc else '' |
