Skip to content

Commit

Permalink
[FIX] account_statement_import_move_line: Set reference in bank state…
Browse files Browse the repository at this point in the history
…ment 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).
  • Loading branch information
pilarvargas-tecnativa committed Oct 29, 2024
1 parent 5bc125f commit bd09337
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _prepare_statement_line_vals(self, statement):
"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,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def setUpClass(cls):
"partner_id": cls.partner.id,
"move_type": "out_invoice",
"journal_id": cls.journal.id,
"ref": "Test",
"invoice_line_ids": [
(
0,
Expand Down

0 comments on commit bd09337

Please sign in to comment.