[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 <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
This commit is contained in:
Camille Spiritus
2022-09-29 09:08:47 +02:00
parent c438197675
commit 525806a039
+2 -4
View File
@@ -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):