From 525806a03920ba7ca9fa68cdf92e35a628bc654c Mon Sep 17 00:00:00 2001 From: Camille Spiritus Date: Wed, 28 Sep 2022 09:00:19 +0000 Subject: [PATCH] [FIX] account: display actual amount in payment view The amount displayed in the payment list view was always the full amount of the invoice This would not always correspond to the actual amount of the payment, for example if a cash discount is applied. Fix: the amount displayed is the amount actually registered task-2991745 closes odoo/odoo#101455 X-original-commit: 98ce4327522533d90f3f6b36dcd171faa5dde086 Signed-off-by: Laurent Smet Signed-off-by: Camille Spiritus (casp) --- addons/account/models/account_payment.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 17b9bd82e57..2da2c0e0453 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -386,10 +386,8 @@ class AccountPayment(models.Model): @api.depends('amount_total_signed', 'payment_type') def _compute_amount_company_currency_signed(self): for payment in self: - if payment.payment_type == 'outbound': - payment.amount_company_currency_signed = -payment.amount_total_signed - else: - payment.amount_company_currency_signed = payment.amount_total_signed + liquidity_lines = payment._seek_for_lines()[0] + payment.amount_company_currency_signed = sum(liquidity_lines.mapped('balance')) @api.depends('amount', 'payment_type') def _compute_amount_signed(self):