summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr/promotion_program_line.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-20 15:06:17 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-20 15:06:17 +0700
commit79bf9729d10c8fb37ef9071ab6df2b6644ddea49 (patch)
tree6226da5e38ad44673a1bb5d7d4e2b0fd5df1fada /indoteknik_custom/models/solr/promotion_program_line.py
parenteb7661705303a64c97e84061b53d48d5c46f6293 (diff)
parentd2bb21ae878db2a3b77dbb3341046c9d12ba1de5 (diff)
Merge branch 'production' into iman/new-register
# Conflicts: # indoteknik_custom/models/res_users.py
Diffstat (limited to 'indoteknik_custom/models/solr/promotion_program_line.py')
-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..3e3a2a28 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.x_name or '',
+ "category_name": category_names,
})
self.solr().add([document])