Skip to content

Commit

Permalink
test: internal transfer for non-stock item
Browse files Browse the repository at this point in the history
  • Loading branch information
s-aga-r committed Jan 4, 2024
1 parent e1b0fff commit 57b6a98
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions erpnext/stock/doctype/delivery_note/test_delivery_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,25 @@ def test_batch_with_non_stock_uom(self):
"Stock Settings", "auto_create_serial_and_batch_bundle_for_outward", 0
)

def test_internal_transfer_for_non_stock_item(self):
from erpnext.selling.doctype.customer.test_customer import create_internal_customer
from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note

item = make_item(properties={"is_stock_item": 0}).name
warehouse = "_Test Warehouse - _TC"
target = "Stores - _TC"
company = "_Test Company"
customer = create_internal_customer(represents_company=company)
rate = 100

so = make_sales_order(item_code=item, qty=1, rate=rate, customer=customer, warehouse=warehouse)
dn = make_delivery_note(so.name)
dn.items[0].target_warehouse = target
dn.save().submit()

self.assertEqual(so.items[0].rate, rate)
self.assertEqual(dn.items[0].rate, so.items[0].rate)


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

0 comments on commit 57b6a98

Please sign in to comment.