diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-21 10:21:01 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-02-21 10:21:01 +0700 |
| commit | 99df2a863b6d641e96b7dd9fafbed701642d5ca7 (patch) | |
| tree | 6e3970b6e4aaf074b564ef7cc316188ee3910a6a /indoteknik_custom/models/promotion | |
| parent | c0daeae791b069aa77baad4b19ecd400c75a42d6 (diff) | |
Fix promotion program line weight
Diffstat (limited to 'indoteknik_custom/models/promotion')
| -rw-r--r-- | indoteknik_custom/models/promotion/promotion_program_line.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/indoteknik_custom/models/promotion/promotion_program_line.py b/indoteknik_custom/models/promotion/promotion_program_line.py index 9fab6e58..ce46d2e7 100644 --- a/indoteknik_custom/models/promotion/promotion_program_line.py +++ b/indoteknik_custom/models/promotion/promotion_program_line.py @@ -97,9 +97,7 @@ class PromotionProgramLine(models.Model): free_products = self.free_product_ids.formats(purchase_qty=qty) merged_products = products + free_products - weight = 0 - if not any(x['package_weight'] == 0 for x in merged_products): - weight = sum(x['package_weight'] for x in merged_products) + weight = sum(x['package_weight'] for x in merged_products) # Sum of products and free products in 1 package quantity products_total = sum(x['price']['price_discount'] * x['qty'] / qty for x in products) |
