diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-16 15:24:28 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-16 15:24:28 +0700 |
| commit | 6d9ac5debfc7f8809e627900555301aac6ab6083 (patch) | |
| tree | 702654e125c3fa4ce72ac0e60677a04dff75ba57 /indoteknik_custom/models/solr | |
| parent | f3e37cbd999409929703ebddef5b487a7daf4940 (diff) | |
Add qty sold field and solr data
Diffstat (limited to 'indoteknik_custom/models/solr')
| -rw-r--r-- | indoteknik_custom/models/solr/product_product.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/solr/product_template.py | 3 |
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) |
