fix: 'get_additonal_costs' is not defined (#20344)
* fix: 'get_additonal_costs' is not defined
* fix: Re-added get_items on Work order change.
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 38e1bc4..170a80f 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -840,18 +840,10 @@
if (me.frm.doc.purpose == "Manufacture" || me.frm.doc.purpose == "Material Consumption for Manufacture" ) {
if (me.frm.doc.purpose == "Manufacture") {
if (!me.frm.doc.to_warehouse) me.frm.set_value("to_warehouse", r.message["fg_warehouse"]);
- if (r.message["additional_costs"].length) {
- me.frm.clear_table("additional_costs");
-
- $.each(r.message["additional_costs"], function(i, row) {
- me.frm.add_child("additional_costs", row);
- })
- refresh_field("additional_costs");
- }
}
if (!me.frm.doc.from_warehouse) me.frm.set_value("from_warehouse", r.message["wip_warehouse"]);
}
- me.get_items()
+ me.get_items();
}
}
});
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 1f2ccb0..02e7abd 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -1401,8 +1401,7 @@
"use_multi_level_bom": work_order.use_multi_level_bom,
"wip_warehouse": work_order.wip_warehouse,
"fg_warehouse": work_order.fg_warehouse,
- "fg_completed_qty": pending_qty_to_produce,
- "additional_costs": get_additional_costs(work_order, fg_qty=pending_qty_to_produce, company=company)
+ "fg_completed_qty": pending_qty_to_produce
}
def get_operating_cost_per_unit(work_order=None, bom_no=None):