From 0eb6f06685e56d932baacc5b1901f938d0c4867e Mon Sep 17 00:00:00 2001 From: abhijitkumbharIND Date: Tue, 21 Jan 2020 19:15:36 +0530 Subject: [PATCH] fix: Gives a 404 error when clicked on the Download Required Material button while the form is not saved (#20355) --- .../manufacturing/doctype/production_plan/production_plan.js | 4 ---- .../doctype/production_plan/production_plan.json | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 7e25b3738b..2b168d1d76 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -218,10 +218,6 @@ frappe.ui.form.on('Production Plan', { }, download_materials_required: function(frm) { - if(frm.is_new()) { - frappe.throw(__("Please save the document before downloading the material required.")); - return; - } let get_template_url = 'erpnext.manufacturing.doctype.production_plan.production_plan.download_raw_materials'; open_url_post(frappe.request.url, { cmd: get_template_url, production_plan: frm.doc.name }); }, diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.json b/erpnext/manufacturing/doctype/production_plan/production_plan.json index af844816e8..77ca6b63d3 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.json +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.json @@ -225,6 +225,7 @@ "options": "Warehouse" }, { + "depends_on": "eval:!doc.__islocal", "fieldname": "download_materials_required", "fieldtype": "Button", "label": "Download Required Materials" @@ -296,7 +297,7 @@ "icon": "fa fa-calendar", "is_submittable": 1, "links": [], - "modified": "2019-12-04 15:58:50.940460", + "modified": "2020-01-21 19:13:10.113854", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Plan",