From d4ee31dc8f42577d7f3b0c9b368c710edf3e290e Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 24 Mar 2022 17:58:22 +0530 Subject: [PATCH] fix: consider all existing PO items When this is sent from API/client side doesn't send temporary_name it can be flaky. Hence, use all available names for validation. --- .../manufacturing/doctype/production_plan/production_plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index b88b24fb25..349f40e9c7 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -64,7 +64,7 @@ class ProductionPlan(Document): Attempt to fix linkages by using temporary names to map final row names. """ new_name_map = {d.temporary_name: d.name for d in self.po_items if d.temporary_name} - actual_names = set(new_name_map.values()) + actual_names = {d.name for d in self.po_items} for sub_assy in self.sub_assembly_items: if sub_assy.production_plan_item not in actual_names: