fix: added test for drop ship partial order
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index a33d401..1d11ad6 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -772,6 +772,56 @@
so.load_from_db()
so.cancel()
+ def test_drop_shipping_partial_order(self):
+ from erpnext.selling.doctype.sales_order.sales_order import make_purchase_order_for_default_supplier, \
+ update_status as so_update_status
+
+ # make items
+ po_item1 = make_item("_Test Item for Drop Shipping 1", {"is_stock_item": 1, "delivered_by_supplier": 1})
+ po_item2 = make_item("_Test Item for Drop Shipping 2", {"is_stock_item": 1, "delivered_by_supplier": 1})
+
+ so_items = [
+ {
+ "item_code": po_item1.item_code,
+ "warehouse": "",
+ "qty": 2,
+ "rate": 400,
+ "delivered_by_supplier": 1,
+ "supplier": '_Test Supplier'
+ },
+ {
+ "item_code": po_item2.item_code,
+ "warehouse": "_Test Warehouse - _TC",
+ "qty": 2,
+ "rate": 300,
+ "conversion_factor": 1.0
+ }
+ ]
+
+ # create so and po
+ so = make_sales_order(item_list=so_items, do_not_submit=True)
+ so.submit()
+
+ # create po for only one item
+ po = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[0]])
+ po.submit()
+
+ self.assertEqual(so.customer, po.customer)
+ self.assertEqual(po.items[0].sales_order, so.name)
+ self.assertEqual(po.items[0].item_code, po_item.item_code)
+ #test po_item length
+ self.assertEqual(len(po.items), 1)
+
+ # create po for remaining item
+ po = make_purchase_order_for_default_supplier(so.name, selected_items=[so_items[1]])
+ po.submit()
+
+ # teardown
+ so_update_status("Draft", so.name)
+ po.cancel()
+ so.load_from_db()
+ so.cancel()
+
def test_reserved_qty_for_closing_so(self):
bin = frappe.get_all("Bin", filters={"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"},
fields=["reserved_qty"])