Skip to content

Commit

Permalink
test: Added new test to check wip skip
Browse files Browse the repository at this point in the history
(cherry picked from commit 6edb454)
  • Loading branch information
mihir-kandoi authored and mergify[bot] committed Jan 15, 2025
1 parent 8ba42cf commit 4e1d400
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
31 changes: 31 additions & 0 deletions erpnext/manufacturing/doctype/work_order/test_work_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -2459,6 +2459,37 @@ def test_components_as_per_bom_for_manufacture_entry(self):

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)
Expand Down
7 changes: 0 additions & 7 deletions erpnext/manufacturing/doctype/work_order/work_order.js
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,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", {
Expand Down

0 comments on commit 4e1d400

Please sign in to comment.