summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/solr/promotion_program_line.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/indoteknik_custom/models/solr/promotion_program_line.py b/indoteknik_custom/models/solr/promotion_program_line.py
index 4b0e67f6..c6dbf213 100644
--- a/indoteknik_custom/models/solr/promotion_program_line.py
+++ b/indoteknik_custom/models/solr/promotion_program_line.py
@@ -37,6 +37,9 @@ class PromotionProgramLine(models.Model):
promotion_type = rec._res_promotion_type()
+ # Gathering all categories
+ category_names = [category.name for category in rec.product_ids.product_id.public_categ_ids]
+
# Set sequence_i to None if rec.sequence is 0
sequence_value = None if rec.sequence == 0 else rec.sequence
@@ -57,7 +60,9 @@ class PromotionProgramLine(models.Model):
'free_products_s': json.dumps(free_products),
'total_qty_i': sum([x.qty for x in rec.product_ids] + [x.qty for x in rec.free_product_ids]),
'total_qty_sold_f': [x.product_id.qty_sold for x in rec.product_ids],
- 'active_b': rec.active
+ 'active_b': rec.active,
+ "manufacture_name_s": rec.product_ids.product_id.x_manufacture.display_name,
+ "category_name": category_names,
})
self.solr().add([document])