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 <deepeshgarg6@gmail.com>
This commit is contained in:
Kitti U. @ Ecosoft 2023-07-14 14:33:00 +07:00 committed by GitHub
parent d5fe1432f8
commit 3b884efca9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(
[