From ff24b3e40c419b91306246dfedfcccd060b6cd37 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:58:22 +0530 Subject: [PATCH] fix: don't get zero value entries for exchange rate calculation (#34475) fix: don't get zero value entries for exchange rate calculation (#34475) * fix: multiply None by float * chore: remove debug (cherry picked from commit 393bc25e2d98e1435dc3ac88d39907e647d56451) Co-authored-by: Devin Slauenwhite --- .../exchange_rate_revaluation/exchange_rate_revaluation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py index a4f6a74a5abf..81c2d8bb7389 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.py @@ -490,6 +490,8 @@ def calculate_exchange_rate_using_last_gle(company, account, party_type, party): conditions.append(gl.company == company) conditions.append(gl.account == account) conditions.append(gl.is_cancelled == 0) + conditions.append((gl.debit > 0) | (gl.credit > 0)) + conditions.append((gl.debit_in_account_currency > 0) | (gl.credit_in_account_currency > 0)) if party_type: conditions.append(gl.party_type == party_type) if party: