refactor: split stock_entry.py into multiple files for better readability

This commit is contained in:
Rohit Waghchaure
2026-05-18 20:16:13 +05:30
parent ae9c632e39
commit e4b5e6bd1e
24 changed files with 3126 additions and 2781 deletions

View File

@@ -378,7 +378,7 @@ class SubcontractingInwardOrder(SubcontractingController):
}
}
stock_entry.add_to_stock_entry_detail(items_dict)
stock_entry.append("items", items_dict[rm_item.get("rm_item_code")])
if target_doc:
return stock_entry
@@ -419,7 +419,7 @@ class SubcontractingInwardOrder(SubcontractingController):
}
}
stock_entry.add_to_stock_entry_detail(items_dict)
stock_entry.append("items", items_dict[rm_item.get("rm_item_code")])
if target_doc:
return stock_entry
@@ -472,7 +472,7 @@ class SubcontractingInwardOrder(SubcontractingController):
}
}
stock_entry.add_to_stock_entry_detail(items_dict)
stock_entry.append("items", items_dict[fg_item.item_code])
if (
frappe.get_single_value("Selling Settings", "deliver_secondary_items")
@@ -497,7 +497,7 @@ class SubcontractingInwardOrder(SubcontractingController):
}
}
stock_entry.add_to_stock_entry_detail(items_dict)
stock_entry.append("items", items_dict[secondary_item.item_code])
if target_doc:
return stock_entry
@@ -542,7 +542,7 @@ class SubcontractingInwardOrder(SubcontractingController):
}
}
stock_entry.add_to_stock_entry_detail(items_dict)
stock_entry.append("items", items_dict[fg_item.item_code])
if target_doc:
return stock_entry

View File

@@ -240,6 +240,7 @@ class IntegrationTestSubcontractingInwardOrder(ERPNextTestSuite):
delivery = frappe.new_doc("Stock Entry").update(scio.make_subcontracting_delivery())
delivery.items[0].use_serial_batch_fields = 1
delivery.save()
delivery.submit()
delivery_serial_list, _ = get_serial_batch_list_from_item(delivery.items[0])
self.assertEqual(sorted(serial_list), sorted(delivery_serial_list))