refactor: update dimensions, only if provided

(cherry picked from commit ec0f17ca8b)
This commit is contained in:
ruthra kumar
2024-01-22 11:59:20 +05:30
committed by Mergify
parent 51bc225fe5
commit 9a3bde9350

View File

@@ -2054,7 +2054,8 @@ def create_gain_loss_journal(
dr_or_cr + "_in_account_currency": 0,
}
)
journal_account.update(dimensions)
if dimensions:
journal_account.update(dimensions)
journal_entry.append("accounts", journal_account)
journal_account = frappe._dict(
@@ -2070,7 +2071,8 @@ def create_gain_loss_journal(
reverse_dr_or_cr: abs(exc_gain_loss),
}
)
journal_account.update(dimensions)
if dimensions:
journal_account.update(dimensions)
journal_entry.append("accounts", journal_account)
journal_entry.save()