Merge branch 'develop' into fix/production-plan/test/planned-qty
diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py
index 8a28454..a73b9bc 100644
--- a/erpnext/manufacturing/doctype/production_plan/production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py
@@ -25,6 +25,7 @@
 from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
 from erpnext.manufacturing.doctype.work_order.work_order import get_item_details
 from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults
+from erpnext.utilities.transaction_base import validate_uom_is_integer
 
 
 class ProductionPlan(Document):
@@ -33,6 +34,7 @@
 		self.calculate_total_planned_qty()
 		self.set_status()
 		self._rename_temporary_references()
+		validate_uom_is_integer(self, "stock_uom", "planned_qty")
 
 	def set_pending_qty_in_row_without_reference(self):
 		"Set Pending Qty in independent rows (not from SO or MR)."
diff --git a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
index e88049d..040e791 100644
--- a/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
+++ b/erpnext/manufacturing/doctype/production_plan/test_production_plan.py
@@ -679,15 +679,23 @@
 		self.assertFalse(pp.all_items_completed())
 
 	def test_production_plan_planned_qty(self):
-		pln = create_production_plan(item_code="_Test FG Item", planned_qty=0.55)
-		pln.make_work_order()
-		work_order = frappe.db.get_value("Work Order", {"production_plan": pln.name}, "name")
-		wo_doc = frappe.get_doc("Work Order", work_order)
-		wo_doc.update(
-			{"wip_warehouse": "Work In Progress - _TC", "fg_warehouse": "Finished Goods - _TC"}
+		# Case 1: When Planned Qty is non-integer and UOM is integer.
+		from erpnext.utilities.transaction_base import UOMMustBeIntegerError
+
+		self.assertRaises(
+			UOMMustBeIntegerError, create_production_plan, item_code="_Test FG Item", planned_qty=0.55
 		)
-		wo_doc.submit()
-		self.assertEqual(wo_doc.qty, 0.55)
+
+		# Case 2: When Planned Qty is non-integer and UOM is also non-integer.
+		from erpnext.stock.doctype.item.test_item import make_item
+
+		fg_item = make_item(properties={"is_stock_item": 1, "stock_uom": "_Test UOM 1"}).name
+		bom_item = make_item().name
+
+		make_bom(item=fg_item, raw_materials=[bom_item], source_warehouse="_Test Warehouse - _TC")
+
+		pln = create_production_plan(item_code=fg_item, planned_qty=0.55, stock_uom="_Test UOM 1")
+		self.assertEqual(pln.po_items[0].planned_qty, 0.55)
 
 	def test_temporary_name_relinking(self):
 
@@ -751,6 +759,7 @@
 				"bom_no": frappe.db.get_value("Item", args.item_code, "default_bom"),
 				"planned_qty": args.planned_qty or 1,
 				"planned_start_date": args.planned_start_date or now_datetime(),
+				"stock_uom": args.stock_uom or "Nos",
 			},
 		)