From 0ac64229439055dce0e42c8dfe8b38a7d3a6cf7b Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Thu, 22 Jan 2015 16:53:46 +0100 Subject: [PATCH] [ADD] Use amount residual to compute cash discount amount on payment order line --- account_cash_discount_payment/wizard/account_payment_create.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_cash_discount_payment/wizard/account_payment_create.py b/account_cash_discount_payment/wizard/account_payment_create.py index 23aec95f1da5..f999aa21ec6b 100644 --- a/account_cash_discount_payment/wizard/account_payment_create.py +++ b/account_cash_discount_payment/wizard/account_payment_create.py @@ -44,7 +44,8 @@ def _prepare_payment_line(self, payment, line): if invoice.discount_due_date >= today: discount = invoice.amount_total - \ invoice.discount_amount - res.update({'amount_currency': invoice.discount_amount, + amount_discount = line.amount_residual - discount + res.update({'amount_currency': amount_discount, 'discount_amount': discount}) return res