From 3b884efca93be67384f1008cf1aed4c2a6505645 Mon Sep 17 00:00:00 2001 From: "Kitti U. @ Ecosoft" Date: Fri, 14 Jul 2023 14:33:00 +0700 Subject: [PATCH] fix: get_dimension with_cost_center_and_project=false is not working. (#35974) * fix: get_dimension with_cost_center_and_project=false is not working. with_cost_center_and_project is no python str, and it always evaluated as True, despite JS call it with false * chore: Linting Issues --------- Co-authored-by: Deepesh Garg --- .../doctype/accounting_dimension/accounting_dimension.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py index 81ff6a52db..15c84d462f 100644 --- a/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py +++ b/erpnext/accounts/doctype/accounting_dimension/accounting_dimension.py @@ -271,6 +271,12 @@ def get_dimensions(with_cost_center_and_project=False): as_dict=1, ) + if isinstance(with_cost_center_and_project, str): + if with_cost_center_and_project.lower().strip() == "true": + with_cost_center_and_project = True + else: + with_cost_center_and_project = False + if with_cost_center_and_project: dimension_filters.extend( [