From 17a8a6d933d701db7bff8f4d17e10ae03fc57ac2 Mon Sep 17 00:00:00 2001 From: Laurent Smet Date: Thu, 23 Jul 2020 08:42:04 +0000 Subject: [PATCH] [FIX] account: Fix missing 'currency_id' on statement lines with amount_currency=0.0 The `currency_id` must be set whatever the amount_currency is zero or not. X-original-commit: 88065aef326dcbe0fb821da8d9aa6cc0316615c7 --- addons/account/models/account_bank_statement.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 68ae1d97503..fd5489ad707 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -587,11 +587,11 @@ class AccountBankStatementLine(models.Model): 'name': self.payment_ref, 'move_id': self.move_id.id, 'partner_id': self.partner_id.id, - 'currency_id': currency_id if amount_currency else False, + 'currency_id': currency_id, 'account_id': journal.default_debit_account_id.id if balance >= 0 else journal.default_credit_account_id.id, 'debit': balance > 0 and balance or 0.0, 'credit': balance < 0 and -balance or 0.0, - 'amount_currency': amount_currency if currency_id else False, + 'amount_currency': amount_currency, } @api.model @@ -772,7 +772,7 @@ class AccountBankStatementLine(models.Model): 'name': counterpart_vals.get('name', move_line.name if move_line else ''), 'move_id': self.move_id.id, 'partner_id': self.partner_id.id, - 'currency_id': currency_id if amount_currency else False, + 'currency_id': currency_id, 'account_id': counterpart_vals.get('account_id', move_line.account_id.id if move_line else False), 'debit': balance if balance > 0 else 0.0, 'credit': -balance if balance < 0 else 0.0,