From 7653a8b9fabc2f3f6f859df0eb0e6ddd8aac4660 Mon Sep 17 00:00:00 2001 From: Marica Date: Mon, 20 Jan 2020 15:46:36 +0530 Subject: [PATCH] fix: 'get_additonal_costs' is not defined (#20344) * fix: 'get_additonal_costs' is not defined * fix: Re-added get_items on Work order change. --- erpnext/stock/doctype/stock_entry/stock_entry.js | 10 +--------- erpnext/stock/doctype/stock_entry/stock_entry.py | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 38e1bc4723..170a80fdf3 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -840,18 +840,10 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ 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 1f2ccb075b..02e7abd505 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -1401,8 +1401,7 @@ def get_work_order_details(work_order, company): "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):