Merge pull request #7018 from nabinhait/fix_10013

Set project from Sales Order while creating Material Request from PPT, fixed #6731
This commit is contained in:
Nabin Hait 2016-11-21 19:06:14 +05:30 committed by GitHub
commit 9789b50ae5

View File

@ -486,7 +486,9 @@ class ProductionPlanningTool(Document):
"qty": requested_qty, "qty": requested_qty,
"schedule_date": add_days(nowdate(), cint(item_wrapper.lead_time_days)), "schedule_date": add_days(nowdate(), cint(item_wrapper.lead_time_days)),
"warehouse": self.purchase_request_for_warehouse, "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 material_request.flags.ignore_permissions = 1