summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-12-08 14:58:52 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-12-08 14:58:52 +0700
commitc1f7742c254898fa5981e8ca7d870ac42d3f8346 (patch)
tree4c12022f63d05560f0cc90d1b50c8bf27521619d
parent37c6b37c68f83a1143c8acdf9b89e05d4d8904fe (diff)
Update document payload for promotion program lines SOLR
-rw-r--r--indoteknik_custom/models/solr/promotion_program_line.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/solr/promotion_program_line.py b/indoteknik_custom/models/solr/promotion_program_line.py
index b0aeaa13..6e182324 100644
--- a/indoteknik_custom/models/solr/promotion_program_line.py
+++ b/indoteknik_custom/models/solr/promotion_program_line.py
@@ -35,12 +35,15 @@ class PromotionProgramLine(models.Model):
'qty': x.qty
} for x in rec.free_product_ids]
+ promotion_type = rec._res_promotion_type()
+
document.update({
'id': rec.id,
'program_id_i': rec.program_id.id,
'name_s': rec.name,
'image_s': self.env['ir.attachment'].api_image(self._name, 'image', rec.id) if rec.image else '',
- 'type_s': json.dumps(rec._res_promotion_type()),
+ 'type_value_s': promotion_type['value'],
+ 'type_label_s': promotion_type['label'],
'package_limit_i': rec.package_limit,
'package_limit_user_i': rec.package_limit_user,
'package_limit_trx_i': rec.package_limit_trx,