diff --git a/addons/sale_coupon/models/sale_order.py b/addons/sale_coupon/models/sale_order.py index f6b953cdaef..a9f0bab4edb 100644 --- a/addons/sale_coupon/models/sale_order.py +++ b/addons/sale_coupon/models/sale_order.py @@ -83,7 +83,10 @@ class SaleOrder(models.Model): max_product_qty = sum(order_lines.mapped('product_uom_qty')) or 1 # Remove needed quantity from reward quantity if same reward and rule product if program._is_valid_product(program.reward_product_id): - reward_product_qty = max_product_qty // (program.rule_min_quantity + program.reward_product_quantity) + # number of times the program should be applied + program_in_order = max_product_qty // (program.rule_min_quantity + program.reward_product_quantity) + # multipled by the reward qty + reward_product_qty = program.reward_product_quantity * program_in_order else: reward_product_qty = min(max_product_qty, self.order_line.filtered(lambda x: x.product_id == program.reward_product_id).product_uom_qty)