[FIX] sale: impossible to generate link if there are an cancel invoice

closes odoo/odoo#72449

X-original-commit: ea08c5a5f077ea991dfe6026f348434873b47bcd
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Florent de Labarre
2021-06-21 14:20:07 +00:00
committed by Victor Feyens
parent 13a6c13666
commit d1a8dfeaec
+1 -1
View File
@@ -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