mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-15 09:53:09 +00:00
test: add regression test for zero quantity Blanket Order
This commit is contained in:
@@ -162,6 +162,26 @@ class TestBlanketOrder(ERPNextTestSuite):
|
|||||||
bo = make_blanket_order(blanket_order_type="Purchasing", supplier=supplier, item_code=item_code)
|
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")
|
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):
|
def make_blanket_order(**args):
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
|
|||||||
Reference in New Issue
Block a user