diff --git a/account_statement_import_camt54/models/account_journal.py b/account_statement_import_camt54/models/account_journal.py index 752187a69..c655f3137 100644 --- a/account_statement_import_camt54/models/account_journal.py +++ b/account_statement_import_camt54/models/account_journal.py @@ -10,5 +10,6 @@ class AccountBankStatementImport(models.Model): transfer_line = fields.Boolean( string="Add balance Line", - help="Generate balance line on total of bank statement import", + help="For camt54 files, generate balance line on total of bank statement " + "import", ) diff --git a/account_statement_import_camt54/models/account_statement_import.py b/account_statement_import_camt54/models/account_statement_import.py index 40b6dbf59..80cb83b92 100644 --- a/account_statement_import_camt54/models/account_statement_import.py +++ b/account_statement_import_camt54/models/account_statement_import.py @@ -20,8 +20,9 @@ def _create_bank_statements(self, stmts_vals, result): statements = self.env["account.bank.statement"].browse(result["statement_ids"]) for statement in statements: amount = sum(statement.line_ids.mapped("amount")) - if statement.journal_id.transfer_line: - if amount != 0: + journal = statement.journal_id + if journal.transfer_line: + if not journal.currency_id.is_zero(amount): amount = -amount statement.line_ids.create( {