summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr/promotion_program_line.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-02-22 14:49:25 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-02-22 14:49:25 +0700
commitda0a75bc6b7166e297bcaf175c15089e95dbbf2e (patch)
tree156cfb319848cd2b2964f83b3cb185e8f920f7b2 /indoteknik_custom/models/solr/promotion_program_line.py
parent6850fd6f86a0fbba3156e59f9ac5836052f019ce (diff)
parent0face879a802bf1a15d1065d59db64f723b4e8d3 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/solr/promotion_program_line.py')
-rw-r--r--indoteknik_custom/models/solr/promotion_program_line.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_custom/models/solr/promotion_program_line.py b/indoteknik_custom/models/solr/promotion_program_line.py
index 6e182324..30ce16c9 100644
--- a/indoteknik_custom/models/solr/promotion_program_line.py
+++ b/indoteknik_custom/models/solr/promotion_program_line.py
@@ -39,9 +39,8 @@ class PromotionProgramLine(models.Model):
document.update({
'id': rec.id,
- 'program_id_i': rec.program_id.id,
+ 'program_id_i': rec.program_id.id or 0,
'name_s': rec.name,
- 'image_s': self.env['ir.attachment'].api_image(self._name, 'image', rec.id) if rec.image else '',
'type_value_s': promotion_type['value'],
'type_label_s': promotion_type['label'],
'package_limit_i': rec.package_limit,
@@ -53,6 +52,7 @@ class PromotionProgramLine(models.Model):
'free_product_ids': [x.product_id.id for x in rec.free_product_ids],
'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]),
+ 'active': rec.active
})
self.solr().add([document])