From 44be67e6ddf7556b6b929b6381675b7919d1c074 Mon Sep 17 00:00:00 2001 From: marination Date: Wed, 13 Apr 2022 11:47:58 +0530 Subject: [PATCH] fix: Map correct company to PO made via Prod Plan (subcontract) (cherry picked from commit 6315acc4507a4e9ff6ea3ec03971b0043e798783) --- erpnext/manufacturing/doctype/production_plan/production_plan.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index d673868a485..ff739e9d72b 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -500,6 +500,7 @@ class ProductionPlan(Document): for supplier, po_list in subcontracted_po.items(): po = frappe.new_doc("Purchase Order") + po.company = self.company po.supplier = supplier po.schedule_date = getdate(po_list[0].schedule_date) if po_list[0].schedule_date else nowdate() po.is_subcontracted = "Yes"