test: add regression test for zero quantity Blanket Order

This commit is contained in:
R-Jayaraman
2026-08-04 19:06:25 +05:30
parent e897c4d82d
commit d80b0f67cc

View File

@@ -162,6 +162,26 @@ class TestBlanketOrder(ERPNextTestSuite):
bo = make_blanket_order(blanket_order_type="Purchasing", supplier=supplier, item_code=item_code)
self.assertEqual(bo.items[0].party_item_code, "SUPP-PART-1")
def test_blanket_order_zero_quantity(self):
bo = frappe.new_doc("Blanket Order")
bo.blanket_order_type = "Selling"
bo.company = "_Test Company"
bo.customer = "_Test Customer"
bo.from_date = today()
bo.to_date = add_months(today(), 12)
bo.append(
"items",
{
"item_code": "_Test Item",
"qty": 0,
"rate": 100,
},
)
with self.assertRaises(frappe.ValidationError):
bo.insert()
def make_blanket_order(**args):
args = frappe._dict(args)