diff --git a/contract_payment_auto/models/contract.py b/contract_payment_auto/models/contract.py index 98749e1c13a..2f590b1f1f6 100644 --- a/contract_payment_auto/models/contract.py +++ b/contract_payment_auto/models/contract.py @@ -142,11 +142,14 @@ def _get_tx_vals(self, invoice, token): """ Return values for creation of a payment.transaction for invoice. """ amount_due = invoice.residual partner = token.partner_id - reference = self.env['payment.transaction']._compute_reference() + reference = self.env['payment.transaction']._compute_reference({ + "invoice_ids": invoice.ids, + }) return { 'reference': '%s' % reference, 'acquirer_id': token.acquirer_id.id, 'payment_token_id': token.id, + 'invoice_ids': [(4, invoice.id)], 'amount': amount_due, 'state': 'draft', 'currency_id': invoice.currency_id.id,