Skip to content

Commit

Permalink
Merge pull request #23991 from pateljannat/job-card-operation-field-e…
Browse files Browse the repository at this point in the history
…rror

fix: job card error handling for operations field
  • Loading branch information
rohitwaghchaure authored Nov 24, 2020
2 parents ccd554c + b67ebc7 commit 5ab2e6c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions erpnext/manufacturing/doctype/job_card/job_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,19 @@ def get_operation_details(work_order, operation):

@frappe.whitelist()
def get_operations(doctype, txt, searchfield, start, page_len, filters):
if filters.get("work_order"):
args = {"parent": filters.get("work_order")}
if txt:
args["operation"] = ("like", "%{0}%".format(txt))

return frappe.get_all("Work Order Operation",
filters = args,
fields = ["distinct operation as operation"],
limit_start = start,
limit_page_length = page_len,
order_by="idx asc", as_list=1)
if not filters.get("work_order"):
frappe.msgprint(_("Please select a Work Order first."))
return []
args = {"parent": filters.get("work_order")}
if txt:
args["operation"] = ("like", "%{0}%".format(txt))

return frappe.get_all("Work Order Operation",
filters = args,
fields = ["distinct operation as operation"],
limit_start = start,
limit_page_length = page_len,
order_by="idx asc", as_list=1)

@frappe.whitelist()
def make_material_request(source_name, target_doc=None):
Expand Down

0 comments on commit 5ab2e6c

Please sign in to comment.