test: ensure enough stock

(cherry picked from commit a441b1c53a)
This commit is contained in:
Smit Vora
2025-12-22 13:19:15 +05:30
committed by Mergify
parent 4d8227a042
commit f6d3bbdf06

View File

@@ -3275,6 +3275,8 @@ class TestWorkOrder(IntegrationTestCase):
"""Test that phantom BOMs are not added to additional costs,
but regular non-stock items in the FG BOM are added."""
from erpnext.stock.doctype.item.test_item import make_item
# Create items:
# - FG Item (stock item)
# - Phantom sub-assembly (non-stock item to be phantom)
@@ -3399,7 +3401,7 @@ class TestWorkOrder(IntegrationTestCase):
fg_bom.insert()
fg_bom.submit()
# Ensure stock for regular RM
# Ensure stock
test_stock_entry.make_stock_entry(
item_code=regular_rm,
target="_Test Warehouse - _TC",
@@ -3407,6 +3409,13 @@ class TestWorkOrder(IntegrationTestCase):
basic_rate=100,
)
test_stock_entry.make_stock_entry(
item_code=phantom_rm,
target="_Test Warehouse - _TC",
qty=10,
basic_rate=200,
)
# Create work order
wo = make_wo_order_test_record(
production_item=fg_item,