From 9b797974b545f2a16bf7d42bb7df7f4c9affe7b5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 21 Nov 2016 18:15:50 +0530 Subject: [PATCH] Set project from Sales Order while creating Material Request from PPT, fixed #6731 --- .../production_planning_tool/production_planning_tool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index aa9e78c399..a3d0f1b406 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -486,7 +486,9 @@ class ProductionPlanningTool(Document): "qty": requested_qty, "schedule_date": add_days(nowdate(), cint(item_wrapper.lead_time_days)), "warehouse": self.purchase_request_for_warehouse, - "sales_order": sales_order if sales_order!="No Sales Order" else None + "sales_order": sales_order if sales_order!="No Sales Order" else None, + "project": frappe.db.get_value("Sales Order", sales_order, "project") \ + if sales_order!="No Sales Order" else None }) material_request.flags.ignore_permissions = 1