From 48f3d535561efd4d2f3d7b0e38c00d23c68cc517 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 17 Jan 2022 22:14:42 +0530 Subject: [PATCH] fix: cover case when all material needs to be bought (#29326) When material request is to be made for purchase qty should be converted to purchase UOM --- .../doctype/production_plan/production_plan.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index 4d31f41c6c..19a0694901 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -947,10 +947,6 @@ def get_materials_from_other_locations(item, warehouses, new_mr_items, company): locations = get_available_item_locations(item.get("item_code"), warehouses, item.get("quantity"), company, ignore_validation=True) - if not locations: - new_mr_items.append(item) - return - required_qty = item.get("quantity") for d in locations: if required_qty <=0: return @@ -970,8 +966,8 @@ def get_materials_from_other_locations(item, warehouses, new_mr_items, company): if required_qty: stock_uom, purchase_uom = frappe.db.get_value( - 'Item', - item['item_code'], + 'Item', + item['item_code'], ['stock_uom', 'purchase_uom'] )