summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-03 09:33:24 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-03 09:33:24 +0700
commit5372bb907b3ed65f5f4de1c8f9202eb1bcb1f93e (patch)
tree80c8374db2fbe104a91efa612961b95a4d56e4b5
parent9808cae54a32a65a41d0a13a141e62d88abedfef (diff)
<iman> add field promotion program line
-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])