From 5956d3e092ea992f96950d757a070e58e3f902a5 Mon Sep 17 00:00:00 2001 From: Sudharsanan11 Date: Thu, 9 Jul 2026 18:23:15 +0530 Subject: [PATCH] fix(stock): accept dict for doc arg in apply_price_list The type-hint refactor rejected the doc dict sent by the form controller; broaden the annotation to match ctx and fix the cts= kwarg typo in transaction_base. --- erpnext/stock/get_item_details.py | 2 +- erpnext/utilities/transaction_base.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index aa076894649..a58c1b037ef 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -1594,7 +1594,7 @@ def get_batch_qty(batch_no: str, warehouse: str, item_code: str): @frappe.whitelist() @erpnext.normalize_ctx_input(ItemDetailsCtx) -def apply_price_list(ctx: ItemDetailsCtx, as_doc: bool = False, doc: Document | str | None = None): +def apply_price_list(ctx: ItemDetailsCtx, as_doc: bool = False, doc: Document | str | dict | None = None): """Apply pricelist on a document-like dict object and return as {'parent': dict, 'children': list} diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 85f2e83f8d9..dd071c0b717 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -575,7 +575,7 @@ class TransactionBase(StatusUpdater): "is_internal_customer": self.is_internal_customer, } # TODO: test method call impact on document - apply_price_list(cts=args, as_doc=True, doc=self) + apply_price_list(ctx=args, as_doc=True, doc=self) def delete_events(ref_type, ref_name):