[FIX] sale_loyalty: prevent partial rewards with points
Since odoo/odoo@b3a2fb51bc, it is not possible to use partial points rewards. However this commit only fixes the behavior for loyalty cards, where it should be applied to many other program types. closes odoo/odoo#143643 X-original-commit: 64ebec5c7db88c247f3dafbeecbd2ae2b9ee4238 Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
This commit is contained in:
@@ -324,7 +324,7 @@ class SaleOrder(models.Model):
|
||||
max_discount = min(self.amount_total, max_discount)
|
||||
if reward.discount_mode == 'per_point':
|
||||
points = self._get_real_points_for_coupon(coupon)
|
||||
if reward.program_type == 'loyalty':
|
||||
if not reward.program_id.is_payment_program:
|
||||
# Rewards cannot be partially offered to customers
|
||||
points = points // reward.required_points * reward.required_points
|
||||
max_discount = min(max_discount,
|
||||
|
||||
Reference in New Issue
Block a user