test: Added new test to check wip skip

This commit is contained in:
Mihir Kandoi
2025-01-15 13:49:11 +05:30
parent 09d26a835f
commit 6edb454eea
2 changed files with 31 additions and 7 deletions

View File

@@ -2475,6 +2475,37 @@ class TestWorkOrder(IntegrationTestCase):
frappe.db.set_single_value("Manufacturing Settings", "validate_components_quantities_per_bom", 0)
def test_wip_skip(self):
wo = make_wo_order_test_record(
item="_Test FG Item",
qty=10,
source_warehouse="_Test Warehouse - _TC",
wip_warehouse="Stores - _TC",
)
manufacture_entry = frappe.get_doc(make_stock_entry(wo.name, "Manufacture", 10))
self.assertEqual(manufacture_entry.items[0].s_warehouse, "Stores - _TC")
wo = make_wo_order_test_record(
item="_Test FG Item",
qty=10,
source_warehouse="_Test Warehouse - _TC",
wip_warehouse="Stores - _TC",
skip_transfer=1,
)
manufacture_entry = frappe.get_doc(make_stock_entry(wo.name, "Manufacture", 10))
self.assertEqual(manufacture_entry.items[0].s_warehouse, "_Test Warehouse - _TC")
wo = make_wo_order_test_record(
item="_Test FG Item",
qty=10,
source_warehouse="_Test Warehouse - _TC",
wip_warehouse="Stores - _TC",
skip_transfer=1,
from_wip_warehouse=1,
)
manufacture_entry = frappe.get_doc(make_stock_entry(wo.name, "Manufacture", 10))
self.assertEqual(manufacture_entry.items[0].s_warehouse, "Stores - _TC")
def make_operation(**kwargs):
kwargs = frappe._dict(kwargs)

View File

@@ -552,13 +552,6 @@ frappe.ui.form.on("Work Order", {
erpnext.work_order.calculate_cost(frm.doc);
erpnext.work_order.calculate_total_cost(frm);
},
skip_transfer: function (frm) {
if (frm.doc.skip_transfer && !frm.doc.from_wip_warehouse) {
frm.set_value("wip_warehouse", null);
frm.refresh_field("wip_warehouse");
}
},
});
frappe.ui.form.on("Work Order Item", {