summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-09-03 09:36:08 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-09-03 09:36:08 +0700
commit5b376d68e62b5d06ff5665b405acc99b89448f06 (patch)
tree0c7c60ef694d37c5e606ea607f8bdb78e3a411b3
parentc617ed4000d1683a5ca9bdcf88b8ec6da6d9f8f0 (diff)
parenta899abec3fbe9c5caa65dd731b3758a9cbc949c1 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
-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])