summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr/product_template.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-11-03 13:46:16 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-11-03 13:46:16 +0700
commite94cfd1fee485d0e84fb50a66a7584572452b5dc (patch)
tree7f0e82becba364b8b984ef27df660635d1e1f9f6 /indoteknik_custom/models/solr/product_template.py
parent566a20db595a2b0a1959a12d289361b16e1ef172 (diff)
parent6b49797aca36574497f93a06f8e1c0622e5ad009 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
# Conflicts: # indoteknik_custom/__manifest__.py # indoteknik_custom/models/__init__.py
Diffstat (limited to 'indoteknik_custom/models/solr/product_template.py')
-rw-r--r--indoteknik_custom/models/solr/product_template.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py
index 25d7d4b8..648a0625 100644
--- a/indoteknik_custom/models/solr/product_template.py
+++ b/indoteknik_custom/models/solr/product_template.py
@@ -36,6 +36,7 @@ class ProductTemplate(models.Model):
def solr_flag_to_solr(self, limit=500):
template_products = self.search([('solr_flag', '=', 2)], limit=limit)
for product in template_products:
+ product._create_solr_queue('_sync_product_template_to_solr')
product._create_solr_queue('_sync_price_to_solr')
product.solr_flag = 1
@@ -136,7 +137,7 @@ class ProductTemplate(models.Model):
price_tier = price_doc.get(f"{price_tier_key}_f", 0)
# When price tier is 0 or variant_price less than price tier then use variant price
- if price_tier == 0 or variant_price < price_tier:
+ if price_tier == 0 or (variant_price < price_tier and variant_price > 0):
price_doc[f"{discount_tier_key}_f"] = variant_discount
price_doc[f"{price_tier_key}_f"] = variant_price