diff --git a/addons/sale/wizard/sale_payment_link.py b/addons/sale/wizard/sale_payment_link.py index df0b865b282..dc136b26b9b 100644 --- a/addons/sale/wizard/sale_payment_link.py +++ b/addons/sale/wizard/sale_payment_link.py @@ -17,7 +17,7 @@ class PaymentLinkWizard(models.TransientModel): record = self.env[res['res_model']].browse(res['res_id']) res.update({ 'description': record.name, - 'amount': record.amount_total - sum(record.invoice_ids.mapped('amount_total')), + 'amount': record.amount_total - sum(record.invoice_ids.filtered(lambda x: x.state != 'cancel').mapped('amount_total')), 'currency_id': record.currency_id.id, 'partner_id': record.partner_id.id, 'amount_max': record.amount_total