summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-23 15:36:50 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-23 15:36:50 +0700
commit5ddda2a380e9aeaf63241e8f6b1c35e3005a3468 (patch)
tree77ea24fac2a7f0b3e6cd4fdc93cfeae2b719bf97
parent3a8d2713d749ce40d3755d4e0b22898ace4b0d6d (diff)
Add action on sync by solr flag
-rw-r--r--indoteknik_custom/models/solr/product_product.py1
-rw-r--r--indoteknik_custom/models/solr/product_template.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py
index 85c94741..03eaaf13 100644
--- a/indoteknik_custom/models/solr/product_product.py
+++ b/indoteknik_custom/models/solr/product_product.py
@@ -25,6 +25,7 @@ class ProductProduct(models.Model):
def variant_solr_flag_to_solr(self, limit=500):
variant_products = self.search([('solr_flag', '=', 2)], limit=limit)
for product in variant_products:
+ product.product_tmpl_id._create_solr_queue('_sync_product_template_to_solr')
product.product_tmpl_id._create_solr_queue('_sync_price_to_solr')
product.solr_flag = 1
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py
index 25d7d4b8..2bbcab9c 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