Skip to content

Commit

Permalink
test: create dn - TC_SCK_151
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek8848 committed Jan 14, 2025
1 parent d6e44df commit 0be8b4f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions erpnext/stock/doctype/delivery_note/test_delivery_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,13 @@ def test_delivery_note_cancel_TC_SCK_054(self):
sle = frappe.get_doc("Stock Ledger Entry", {"voucher_type": "Delivery Note", "voucher_no": dn.name,"is_cancelled":1})
self.assertEqual(sle.get("actual_qty"), 10)

def test_create_dn_neg_TC_SCK_151(self):
frappe.db.set_single_value("Stock Settings", "allow_negative_stock", 1)
item = create_item("OP-MB-001")
dn = create_delivery_note(qty=5,item=item.item_code)
sle = frappe.get_doc('Stock Ledger Entry',{'voucher_no':dn.name})
self.assertEqual(sle.qty_after_transaction, -5)

def create_delivery_note(**args):
dn = frappe.new_doc("Delivery Note")
args = frappe._dict(args)
Expand Down

0 comments on commit 0be8b4f

Please sign in to comment.