summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr/product_template.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-09-13 11:42:17 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-09-13 11:42:17 +0700
commit7c67529ed27e32d32a6ddc4cd3fe296ce0d7bca2 (patch)
tree1b343cd085e472379426d159c7b8dc595af2d240 /indoteknik_custom/models/solr/product_template.py
parent70a8e601fb661398bd7f6b826b4851bd915249c4 (diff)
parent8cd5ba78d36ebb399a69e87aa2bdd76b01bf5504 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/solr/product_template.py')
-rw-r--r--indoteknik_custom/models/solr/product_template.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py
index ec42746c..3470621e 100644
--- a/indoteknik_custom/models/solr/product_template.py
+++ b/indoteknik_custom/models/solr/product_template.py
@@ -38,10 +38,9 @@ class ProductTemplate(models.Model):
def solr_flag_to_solr(self, limit=500):
template_products = self.search([('solr_flag', '=', 2)], limit=limit)
- if template_products:
- for product in template_products:
- product._create_solr_queue('_sync_price_to_solr')
- product.solr_flag = 1
+ for product in template_products:
+ product._create_solr_queue('_sync_price_to_solr')
+ product.solr_flag = 1
def _sync_active_template_solr(self):
for template in self:
@@ -164,8 +163,6 @@ class ProductTemplate(models.Model):
self.solr().delete(rec.id)
for variant in rec.product_variant_ids:
variant._sync_delete_solr()
- self.solr().optimize()
- self.solr().commit()
def solr_results(self, detail=False):
solr_model = self.env['apache.solr']