[FIX] account_financial_report: KeyError rendering report

Some reports were failing to render without this fix.

It seems there was a regression introduced in 0a2b2736cd.

@moduon MT-8285
pull/1262/head
Jairo Llopis 2024-12-03 11:13:50 +01:00 committed by Víctor Martínez
parent 0a7c7b9656
commit e2bfb27597
1 changed files with 1 additions and 0 deletions

View File

@ -877,6 +877,7 @@ class GeneralLedgerReport(models.AbstractModel):
fin_bal_currency_ids = [] fin_bal_currency_ids = []
fin_bal_currency_id = gl_item["currency_id"] fin_bal_currency_id = gl_item["currency_id"]
if gl_item["currency_id"] or not foreign_currency: if gl_item["currency_id"] or not foreign_currency:
gl_item["fin_bal_currency_id"] = fin_bal_currency_id
continue continue
gl_item["fin_bal"]["bal_curr"] = gl_item["init_bal"]["bal_curr"] gl_item["fin_bal"]["bal_curr"] = gl_item["init_bal"]["bal_curr"]
if "move_lines" in gl_item: if "move_lines" in gl_item: