From d6b9cc9b69c66aed20e6a8c9b0ffa6ded1003937 Mon Sep 17 00:00:00 2001 From: pilarvargas-tecnativa Date: Tue, 29 Oct 2024 12:11:33 +0100 Subject: [PATCH] [FIX] account_statement_import_move_line: Set reference in bank statement lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- account_statement_import_move_line/models/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_statement_import_move_line/models/account_move_line.py b/account_statement_import_move_line/models/account_move_line.py index af88721c..a268ddf6 100644 --- a/account_statement_import_move_line/models/account_move_line.py +++ b/account_statement_import_move_line/models/account_move_line.py @@ -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, }