From 1a27ae4f9ec137d7af69175afb67a094873738b9 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 24 Nov 2023 16:51:02 +0700 Subject: add new condition on publish_b solr --- indoteknik_custom/models/solr/product_product.py | 2 +- indoteknik_custom/models/solr/product_template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py index 03eaaf13..ebfa8e65 100644 --- a/indoteknik_custom/models/solr/product_product.py +++ b/indoteknik_custom/models/solr/product_product.py @@ -65,7 +65,7 @@ class ProductProduct(models.Model): 'search_rank_weekly_i': variant.product_tmpl_id.search_rank_weekly, 'attributes': [x.name for x in variant.product_template_attribute_value_ids], 'has_product_info_b': True, - 'publish_b': not variant.unpublished, + 'publish_b': not variant.unpublished or not variant.active, 'qty_sold_f': variant.qty_sold }) diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py index 648a0625..123a95ac 100644 --- a/indoteknik_custom/models/solr/product_template.py +++ b/indoteknik_custom/models/solr/product_template.py @@ -82,7 +82,7 @@ class ProductTemplate(models.Model): "category_name": category_name, "description_t": template.website_description or '', 'has_product_info_b': True, - 'publish_b': not template.unpublished, + 'publish_b': not template.unpublished or not template.active, "qty_sold_f": template.qty_sold }) -- cgit v1.2.3