mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-17 00:18:39 +00:00
refactor: parse native JSON request args in stock/doctype/stock_entry/services/subcontracting.py
Use frappe.parse_json instead of json.loads so the whitelisted endpoints accept native JSON types (list/dict/bool) in addition to JSON strings.
This commit is contained in:
@@ -253,8 +253,7 @@ def get_supplied_items(
|
||||
def get_items_from_subcontract_order(source_name: str, target_doc: str | Document | None = None):
|
||||
from erpnext.controllers.subcontracting_controller import make_rm_stock_entry
|
||||
|
||||
if isinstance(target_doc, str):
|
||||
target_doc = frappe.get_doc(json.loads(target_doc))
|
||||
target_doc = frappe.get_doc(frappe.parse_json(target_doc))
|
||||
|
||||
order_doctype = "Purchase Order" if target_doc.purchase_order else "Subcontracting Order"
|
||||
target_doc = make_rm_stock_entry(
|
||||
|
||||
Reference in New Issue
Block a user