summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-07-11 13:25:54 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-07-11 13:25:54 +0700
commit063c508d87b164380eeeb5ff2be46909a7c23771 (patch)
treea3775f3e89d08082e122c1071e0e2f4e499a07ed
parenta2c5c098f1973b0153f157e8e98b7536a4941734 (diff)
add image program
-rw-r--r--indoteknik_custom/models/promotion/promotion_program_line.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_custom/models/promotion/promotion_program_line.py b/indoteknik_custom/models/promotion/promotion_program_line.py
index 69aa4959..a57f1f2c 100644
--- a/indoteknik_custom/models/promotion/promotion_program_line.py
+++ b/indoteknik_custom/models/promotion/promotion_program_line.py
@@ -106,9 +106,12 @@ class PromotionProgramLine(models.Model):
products_total = sum(x['price']['price'] * x['qty'] / qty for x in products)
free_products_total = sum(x['price']['price'] * x['qty'] / qty for x in free_products)
package_price = products_total + free_products_total
+
+ image = self.env['ir.attachment'].api_image('promotion.program', 'image', self.program_id.id),
response = {
'id': self.id,
+ 'image_program': image,
'name': self.name,
'remaining_time': self._get_remaining_time(),
'promotion_type': self._res_promotion_type(),