fix: accept dict doc when reserving stock for work order

This commit is contained in:
Shllokkk
2026-07-31 20:10:05 +05:30
parent 0fdca37506
commit f29c7de0ef

View File

@@ -546,10 +546,10 @@ class WorkOrderStockReservation:
@frappe.whitelist()
def make_stock_reservation_entries(
doc: str | Document, items: str | list | None = None, is_transfer: bool = True, notify: bool = False
doc: str | dict, items: str | list | None = None, is_transfer: bool = True, notify: bool = False
):
"""Whitelisted entry point: verify Work Order write access, then reserve stock."""
if isinstance(doc, str):
if isinstance(doc, str | dict):
doc = parse_json(doc)
doc = frappe.get_doc("Work Order", doc.get("name"))