From f26cb793b142bcf93335bcde0d81a85563978cff Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 1 Jul 2026 16:19:07 +0530 Subject: [PATCH] fix: restore | dict + normalization on non-decorated helpers get_item_price is an internal, non-decorated helper: the "| dict" and "pctx = frappe._dict(pctx)" were load-bearing (callers may pass a plain dict; the body does attribute access). Restore both. Also restore the "| dict" on set_valuation_rate/update_party_blanket_order out params (these are not normalize_ctx_input-decorated). Co-Authored-By: Claude Opus 4.8 --- erpnext/stock/get_item_details.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 45eaae5ea59..5f6e7ab6cbd 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -188,7 +188,7 @@ def remove_standard_fields(out: ItemDetailsCtx): return out -def set_valuation_rate(out: ItemDetailsCtx, ctx: ItemDetailsCtx): +def set_valuation_rate(out: ItemDetailsCtx | dict, ctx: ItemDetailsCtx): from erpnext.selling.doctype.product_bundle.product_bundle import get_active_product_bundle active_bundle = get_active_product_bundle(ctx.item_code) @@ -1215,7 +1215,7 @@ def _get_stock_uom_rate(rate: float, ctx: ItemDetailsCtx): def get_item_price( - pctx: ItemDetailsCtx, item_code, ignore_party=False, force_batch_no=False + pctx: ItemDetailsCtx | dict, item_code, ignore_party=False, force_batch_no=False ) -> list[dict]: """ Get name, price_list_rate from Item Price based on conditions @@ -1224,6 +1224,7 @@ def get_item_price( optional fields transaction_date, customer, supplier :param item_code: str, Item Doctype field item_code """ + pctx: ItemDetailsCtx = frappe._dict(pctx) ip = frappe.qb.DocType("Item Price") query = ( @@ -1761,7 +1762,7 @@ def get_serial_no(_args: Any, serial_nos: list | None = None, sales_order: str | return serial_nos -def update_party_blanket_order(ctx: ItemDetailsCtx, out: ItemDetailsCtx): +def update_party_blanket_order(ctx: ItemDetailsCtx, out: ItemDetailsCtx | dict): if out["against_blanket_order"]: blanket_order_details = get_blanket_order_details(ctx) if blanket_order_details: