mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 06:29:20 +00: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)
|
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)
|
stitch_bom = create_semi_fg_bom(stitch_fg.name, cut_fg.name, inspection_required=0)
|
||||||
final_bom = frappe.new_doc(
|
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("items", {"item_code": raw.name, "qty": 1})
|
||||||
final_bom.append(
|
final_bom.append(
|
||||||
@@ -120,6 +125,7 @@ class TestJobCard(ERPNextTestSuite):
|
|||||||
final_bom.append("items", {"item_code": stitch_fg.name, "qty": 1, "operation_row_id": 3})
|
final_bom.append("items", {"item_code": stitch_fg.name, "qty": 1, "operation_row_id": 3})
|
||||||
final_bom.submit()
|
final_bom.submit()
|
||||||
work_order = make_work_order(final_bom.name, final.name, 1, variant_items=[], use_multi_level_bom=0)
|
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.wip_warehouse = "Work In Progress - WP"
|
||||||
work_order.fg_warehouse = "Finished Goods - WP"
|
work_order.fg_warehouse = "Finished Goods - WP"
|
||||||
work_order.scrap_warehouse = "All Warehouses - WP"
|
work_order.scrap_warehouse = "All Warehouses - WP"
|
||||||
@@ -933,6 +939,7 @@ def make_wo_with_transfer_against_jc():
|
|||||||
|
|
||||||
def create_semi_fg_bom(semi_fg_item, raw_item, inspection_required):
|
def create_semi_fg_bom(semi_fg_item, raw_item, inspection_required):
|
||||||
bom = frappe.new_doc("BOM")
|
bom = frappe.new_doc("BOM")
|
||||||
|
bom.company = "Wind Power LLC"
|
||||||
bom.item = semi_fg_item
|
bom.item = semi_fg_item
|
||||||
bom.quantity = 1
|
bom.quantity = 1
|
||||||
bom.inspection_required = inspection_required
|
bom.inspection_required = inspection_required
|
||||||
|
|||||||
@@ -935,8 +935,6 @@ class ERPNextTestSuite(unittest.TestCase):
|
|||||||
"abbr": "WP",
|
"abbr": "WP",
|
||||||
"industry": "Manufacturing",
|
"industry": "Manufacturing",
|
||||||
"country": "United States",
|
"country": "United States",
|
||||||
# "fy_start_date": f"{current_year}-01-01",
|
|
||||||
# "fy_end_date": f"{current_year}-12-31",
|
|
||||||
"language": "english",
|
"language": "english",
|
||||||
"company_tagline": "Testing",
|
"company_tagline": "Testing",
|
||||||
"email": "test@erpnext.com",
|
"email": "test@erpnext.com",
|
||||||
|
|||||||
Reference in New Issue
Block a user