diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 4e78555635..0565341f8a 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -233,6 +233,7 @@ def make_sales_order(**args): so.company = args.company or "_Test Company" so.customer = args.customer or "_Test Customer" so.delivery_date = add_days(so.transaction_date, 10) + so.currency = args.currency or "INR" so.append("items", { "item_code": args.item or args.item_code or "_Test Item", diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 8556c928b4..db23eb9f23 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -189,6 +189,7 @@ def create_delivery_note(**args): dn.company = args.company or "_Test Company" dn.customer = args.customer or "_Test Customer" + dn.currency = args.currency or "INR" dn.append("items", { "item_code": args.item or args.item_code or "_Test Item", diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 0af87c3546..141bcd4d0d 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -78,6 +78,12 @@ class TestPurchaseReceipt(unittest.TestCase): set_perpetual_inventory(0) def test_subcontracting(self): + from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry + + make_stock_entry(item_code="_Test Item", target="_Test Warehouse 1 - _TC", qty=100, incoming_rate=100) + make_stock_entry(item_code="_Test Item Home Desktop 100", target="_Test Warehouse 1 - _TC", + qty=100, incoming_rate=100) + pr = make_purchase_receipt(item_code="_Test FG Item", qty=10, rate=500, is_subcontracted="Yes") self.assertEquals(len(pr.get("supplied_items")), 2) @@ -135,6 +141,7 @@ def make_purchase_receipt(**args): pr.supplier = args.supplier or "_Test Supplier" pr.is_subcontracted = args.is_subcontracted or "No" pr.supplier_warehouse = "_Test Warehouse 1 - _TC" + pr.currency = args.currency or "INR" pr.append("items", { "item_code": args.item or args.item_code or "_Test Item",