You could do it with a simple CASE in the SQL query, but you need the value of the "account_account.currency_id" column, which may not be currently included in the query - so a bit of refactoring may be needed.
Something like:
'foreign_balance': "CASE WHEN account_account.currency_id is NULL THEN 0 ELSE COALESCE(SUM(l.amount_currency), 0) END as foreign_balance"
It's not currently used in P&L, but only in the special "Unrealized Gain or Loss" report in Multi-Currency reports.
It could be added in P&L for information purpose, but only for accounts with secondary currencies.
You could do it with a simple CASE in the SQL query, but you need the value of the "account_ account. currency_ id" column, which may not be currently included in the query - so a bit of refactoring may be needed. balance' : "CASE WHEN account_ account. currency_ id is NULL THEN 0 ELSE COALESCE( SUM(l.amount_ currency) , 0) END as foreign_balance"
Something like:
'foreign_
It's not currently used in P&L, but only in the special "Unrealized Gain or Loss" report in Multi-Currency reports.
It could be added in P&L for information purpose, but only for accounts with secondary currencies.