diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index 1217790113..60373972b9 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -218,7 +218,7 @@ $.extend(cur_frm.cscript, { project: doc.project }, callback: function(r) { - $.each(["description", "stock_uom", "bom_no"], function(i, field) { + $.each(["description", "stock_uom", "project", "bom_no"], function(i, field) { cur_frm.set_value(field, r.message[field]); }); diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 2d9a06711a..b9b10c159a 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -498,6 +498,7 @@ def get_item_details(item, project = None): frappe.throw(_("Default BOM for {0} not found for Project {1}").format(item, project)) frappe.throw(_("Default BOM for {0} not found").format(item)) + res['project'] = frappe.db.get_value('BOM', res['bom_no'], 'project') res.update(check_if_scrap_warehouse_mandatory(res["bom_no"])) return res