fix: 'get_additonal_costs' is not defined (#20344)

* fix: 'get_additonal_costs' is not defined

* fix: Re-added get_items on Work order change.
This commit is contained in:
Marica 2020-01-20 15:46:36 +05:30 committed by Nabin Hait
parent 03b116dd01
commit 7653a8b9fa
2 changed files with 2 additions and 11 deletions

View File

@ -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();
}
}
});

View File

@ -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):