From 4a114d4ea58f01c2b88b7ee04f493cc3ddf63dd8 Mon Sep 17 00:00:00 2001 From: Borruso Date: Fri, 10 May 2024 11:11:31 +0200 Subject: [PATCH] [FIX] account_fiscal_year_closing: move line created with correct currency --- .../models/account_fiscalyear_closing.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/account_fiscal_year_closing/models/account_fiscalyear_closing.py b/account_fiscal_year_closing/models/account_fiscalyear_closing.py index 802e296699f..7733f2eb936 100644 --- a/account_fiscal_year_closing/models/account_fiscalyear_closing.py +++ b/account_fiscal_year_closing/models/account_fiscalyear_closing.py @@ -604,6 +604,15 @@ def move_line_prepare(self, account, account_lines, partner_id=False): "date": date, "partner_id": partner_id, } + if ( + account.currency_id + and account.currency_id != account.company_currency_id + ): + amount_currency = sum(account_lines.mapped("amount_currency")) * -1 + move_line.update( + currency_id=account.currency_id.id, + amount_currency=amount_currency, + ) else: balance = 0 return balance, move_line