summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models/solr')
-rw-r--r--indoteknik_custom/models/solr/product_product.py1
-rw-r--r--indoteknik_custom/models/solr/product_template.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py
index 31a0026d..720be7fa 100644
--- a/indoteknik_custom/models/solr/product_product.py
+++ b/indoteknik_custom/models/solr/product_product.py
@@ -64,6 +64,7 @@ class ProductProduct(models.Model):
'attributes': [x.name for x in variant.product_template_attribute_value_ids],
'has_product_info_b': True,
'publish_b': variant.product_tmpl_id.active and variant.product_tmpl_id.type == 'product',
+ 'qty_sold_f': variant.qty_sold
})
self.solr().add(docs=[document], softCommit=True)
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py
index d7439bcb..cc8d4bf2 100644
--- a/indoteknik_custom/models/solr/product_template.py
+++ b/indoteknik_custom/models/solr/product_template.py
@@ -80,7 +80,8 @@ class ProductTemplate(models.Model):
"category_name": category_name,
"description_t": template.website_description or '',
'has_product_info_b': True,
- 'publish_b': template.active and template.type == 'product'
+ 'publish_b': template.active and template.type == 'product',
+ "qty_sold_f": template.qty_sold
})
self.solr().add(docs=[document], softCommit=True)