From 5f4b6d267cb1caba153692405578beb558e006f5 Mon Sep 17 00:00:00 2001 From: Khushal Trivedi Date: Wed, 16 Oct 2019 13:40:58 +0530 Subject: [PATCH] [Fix] - making customer/supplier field manadatory on order type condition on BO --- erpnext/manufacturing/doctype/blanket_order/blanket_order.js | 3 +++ .../manufacturing/doctype/blanket_order/blanket_order.json | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order.js b/erpnext/manufacturing/doctype/blanket_order/blanket_order.js index 8f0a5e0133..b6ad27632e 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order.js +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order.js @@ -53,6 +53,7 @@ frappe.ui.form.on('Blanket Order', { if (frm.doc.blanket_order_type === 'Selling') { frm.set_df_property("customer","reqd", 1) frm.set_df_property("supplier","reqd", 0) + frm.set_value("supplier", "") frm.set_query("tc_name", function() { return { filters: { selling: 1 } }; @@ -61,6 +62,8 @@ frappe.ui.form.on('Blanket Order', { if (frm.doc.blanket_order_type === 'Purchasing') { frm.set_df_property("supplier","reqd", 1) frm.set_df_property("customer","reqd", 0) + frm.set_value("customer", "") + frm.set_query("tc_name", function() { return { filters: { buying: 1 } }; diff --git a/erpnext/manufacturing/doctype/blanket_order/blanket_order.json b/erpnext/manufacturing/doctype/blanket_order/blanket_order.json index 570d435c5f..260e0b8a73 100644 --- a/erpnext/manufacturing/doctype/blanket_order/blanket_order.json +++ b/erpnext/manufacturing/doctype/blanket_order/blanket_order.json @@ -88,7 +88,8 @@ "fieldname": "company", "fieldtype": "Link", "label": "Company", - "options": "Company" + "options": "Company", + "reqd": 1 }, { "fieldname": "section_break_12", @@ -128,7 +129,7 @@ } ], "is_submittable": 1, - "modified": "2019-06-19 11:59:09.279607", + "modified": "2019-10-16 13:38:32.302316", "modified_by": "Administrator", "module": "Manufacturing", "name": "Blanket Order",