diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-09-03 02:35:04 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-09-03 02:35:04 +0000 |
| commit | a899abec3fbe9c5caa65dd731b3758a9cbc949c1 (patch) | |
| tree | cc03aa5214b463d009633af84a76cc64e5bc5681 | |
| parent | 3d70fa89180cd3318b0f952c0f628d3bb1313340 (diff) | |
| parent | 5372bb907b3ed65f5f4de1c8f9202eb1bcb1f93e (diff) | |
Merged in add_field_programLine (pull request #212)
<iman> add field promotion program line
| -rw-r--r-- | indoteknik_custom/models/solr/promotion_program_line.py | 7 |
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]) |
