[FIX] account_statement_import_move_line: Set reference in bank statement lines

The ‘ref’ field is not visible on invoices of type ‘out_invoice’.
In the tests, it is adding value to this field and therefore does not
fail to create a bank statement line where the ‘payment_ref’ field is
required. To solve this, the value of the ‘payment_ref’ field of the
bank statement lines is set as the reference of a supplier invoice
(‘ref’ in invoice lines) or as the reference of the payment
‘payment_reference’ (‘name’ in invoice lines).
This commit is contained in:
pilarvargas-tecnativa
2024-10-29 12:11:33 +01:00
parent 1070e0a472
commit d6b9cc9b69

View File

@@ -19,7 +19,7 @@ class AccountMoveLine(models.Model):
"amount": amount,
"partner_id": self.partner_id.id,
"statement_id": statement.id,
"payment_ref": self.ref,
"payment_ref": self.ref or self.name,
"date": self.date_maturity,
"currency_id": self.currency_id.id,
}