mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 05:32:46 +01:00
refactor(test): make job card deterministic
This commit is contained in:
@@ -86,7 +86,12 @@ class TestJobCard(ERPNextTestSuite):
|
||||
cut_bom = create_semi_fg_bom(cut_fg.name, raw.name, inspection_required=1)
|
||||
stitch_bom = create_semi_fg_bom(stitch_fg.name, cut_fg.name, inspection_required=0)
|
||||
final_bom = frappe.new_doc(
|
||||
"BOM", item=final.name, quantity=1, with_operations=1, track_semi_finished_goods=1
|
||||
"BOM",
|
||||
item=final.name,
|
||||
quantity=1,
|
||||
with_operations=1,
|
||||
track_semi_finished_goods=1,
|
||||
company=self.companies[9].name,
|
||||
)
|
||||
final_bom.append("items", {"item_code": raw.name, "qty": 1})
|
||||
final_bom.append(
|
||||
@@ -121,6 +126,7 @@ class TestJobCard(ERPNextTestSuite):
|
||||
final_bom.insert()
|
||||
final_bom.submit()
|
||||
work_order = make_work_order(final_bom.name, final.name, 1, variant_items=[], use_multi_level_bom=0)
|
||||
work_order.company = self.companies[9].name
|
||||
work_order.wip_warehouse = "Work In Progress - WP"
|
||||
work_order.fg_warehouse = "Finished Goods - WP"
|
||||
work_order.scrap_warehouse = "All Warehouses - WP"
|
||||
@@ -886,6 +892,7 @@ class TestJobCard(ERPNextTestSuite):
|
||||
|
||||
def create_bom(raw_material, finished_good, scrap_item, submit=True):
|
||||
bom = frappe.new_doc("BOM")
|
||||
bom.company = "_Test Company"
|
||||
bom.item = finished_good
|
||||
bom.quantity = 1
|
||||
bom.append("items", {"item_code": raw_material, "qty": 1})
|
||||
@@ -1118,6 +1125,7 @@ def make_wo_with_transfer_against_jc():
|
||||
|
||||
def create_semi_fg_bom(semi_fg_item, raw_item, inspection_required):
|
||||
bom = frappe.new_doc("BOM")
|
||||
bom.company = "Wind Power LLC"
|
||||
bom.item = semi_fg_item
|
||||
bom.quantity = 1
|
||||
bom.inspection_required = inspection_required
|
||||
|
||||
@@ -935,8 +935,6 @@ class ERPNextTestSuite(unittest.TestCase):
|
||||
"abbr": "WP",
|
||||
"industry": "Manufacturing",
|
||||
"country": "United States",
|
||||
# "fy_start_date": f"{current_year}-01-01",
|
||||
# "fy_end_date": f"{current_year}-12-31",
|
||||
"language": "english",
|
||||
"company_tagline": "Testing",
|
||||
"email": "test@erpnext.com",
|
||||
|
||||
Reference in New Issue
Block a user