From 657c85638ce83e906df6aa95c3f77b4a04b61154 Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:03:57 +0100 Subject: [PATCH] fix: get value from dict (#44492) `doc.taxes` is not always a `frappe._dict`, it can also be a regular `dict`. Resolves #44328 --- erpnext/stock/get_item_details.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 8809e0e3d25..f36795966d9 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -690,8 +690,8 @@ def is_within_valid_range(ctx: ItemDetailsCtx, tax) -> bool: def get_item_tax_map(*, doc: str | dict | Document, tax_template: str | None = None, as_json=True): doc = parse_json(doc) item_tax_map = {} - for t in (t for t in (doc.get("taxes") or []) if not t.set_by_item_tax_template): - item_tax_map[t.account_head] = t.rate + for t in (t for t in (doc.get("taxes") or []) if not t.get("set_by_item_tax_template")): + item_tax_map[t.get("account_head")] = t.get("rate") if tax_template: template = frappe.get_cached_doc("Item Tax Template", tax_template)