From 20794ac9ce3d8e45122f8041ac84b950510646a4 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 35deeb6e65b..a262b91cb5f 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: