From 11ba553dbd72996de1118c27743dea30267a4244 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Mon, 17 Jul 2023 18:40:52 +0530 Subject: [PATCH] fix: dict value for dimension for gl entries defined without the dimension (cherry picked from commit ed3bef1840ac7482f673a69f01dfdb7608037955) --- erpnext/accounts/general_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 4b837e2cd710..30c6d19f90b1 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -90,7 +90,7 @@ def get_accounting_dimensions_for_offsetting_entry(gl_map): accounting_dimensions_to_offset = [] for acc_dimension in acc_dimensions: fieldname = acc_dimension.lower().replace(" ", "_") - values = set([entry[fieldname] for entry in gl_map]) + values = set([entry.get(fieldname) for entry in gl_map]) if len(values) > 1: accounting_dimensions_to_offset.append(acc_dimension) return accounting_dimensions_to_offset