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
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index 4d31f41..19a0694 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -947,10 +947,6 @@
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 @@
if required_qty:
stock_uom, purchase_uom = frappe.db.get_value(
- 'Item',
- item['item_code'],
+ 'Item',
+ item['item_code'],
['stock_uom', 'purchase_uom']
)