Merge pull request #25886 from ankush/work_order_flat_ops

fix: order and time of operations in multilevel BOM work order
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index c64084f..ca174a3 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -438,6 +438,13 @@
 @frappe.whitelist()
 def get_item_tax_info(company, tax_category, item_codes, item_rates=None, item_tax_templates=None):
 	out = {}
+
+	if item_tax_templates is None:
+		item_tax_templates = {}
+	
+	if item_rates is None:
+		item_rates = {}
+
 	if isinstance(item_codes, (str,)):
 		item_codes = json.loads(item_codes)
 
@@ -453,7 +460,7 @@
 
 		out[item_code[1]] = {}
 		item = frappe.get_cached_doc("Item", item_code[0])
-		args = {"company": company, "tax_category": tax_category, "net_rate": item_rates[item_code[1]]}
+		args = {"company": company, "tax_category": tax_category, "net_rate": item_rates.get(item_code[1])}
 
 		if item_tax_templates:
 			args.update({"item_tax_template": item_tax_templates.get(item_code[1])})