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.
This commit is contained in:
Sudharsanan11
2026-07-09 18:23:15 +05:30
parent 8b3caeb578
commit 5956d3e092
2 changed files with 2 additions and 2 deletions

View File

@@ -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}

View File

@@ -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):