fix: job card error handling for operations field
This commit is contained in:
parent
da878c43fc
commit
b67ebc7636
@ -353,17 +353,19 @@ def get_operation_details(work_order, operation):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_operations(doctype, txt, searchfield, start, page_len, filters):
|
def get_operations(doctype, txt, searchfield, start, page_len, filters):
|
||||||
if filters.get("work_order"):
|
if not filters.get("work_order"):
|
||||||
args = {"parent": filters.get("work_order")}
|
frappe.msgprint(_("Please select a Work Order first."))
|
||||||
if txt:
|
return []
|
||||||
args["operation"] = ("like", "%{0}%".format(txt))
|
args = {"parent": filters.get("work_order")}
|
||||||
|
if txt:
|
||||||
|
args["operation"] = ("like", "%{0}%".format(txt))
|
||||||
|
|
||||||
return frappe.get_all("Work Order Operation",
|
return frappe.get_all("Work Order Operation",
|
||||||
filters = args,
|
filters = args,
|
||||||
fields = ["distinct operation as operation"],
|
fields = ["distinct operation as operation"],
|
||||||
limit_start = start,
|
limit_start = start,
|
||||||
limit_page_length = page_len,
|
limit_page_length = page_len,
|
||||||
order_by="idx asc", as_list=1)
|
order_by="idx asc", as_list=1)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_material_request(source_name, target_doc=None):
|
def make_material_request(source_name, target_doc=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user