fix: Dont set `idx` while adding WO items to Stock Entry
- `idx` must be computed by base document's `self.append()` function, so do not set it
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 99cf4de..26d59fd 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -1603,8 +1603,11 @@
se_child.is_scrap_item = item_row.get("is_scrap_item", 0)
se_child.is_process_loss = item_row.get("is_process_loss", 0)
- for field in ["idx", "po_detail", "original_item", "expense_account",
- "description", "item_name", "serial_no", "batch_no", "allow_zero_valuation_rate"]:
+ for field in [
+ "po_detail", "original_item", "expense_account",
+ "description", "item_name", "serial_no",
+ "batch_no", "allow_zero_valuation_rate"
+ ]:
if item_row.get(field):
se_child.set(field, item_row.get(field))