fix: Added conditional check for conversion factor

This commit is contained in:
marination 2019-11-20 12:38:58 +05:30
parent a076bddd83
commit e537cda062

View File

@ -254,11 +254,11 @@ frappe.ui.form.on('Stock Entry', {
stock_entry_type: function(frm){
frm.remove_custom_button('Bill of Materials', "Get items from");
if (frm.doc.docstatus === 0 && ['Material Issue','Material Receipt',
'Material Transfer','Send to Subcontractor'].includes(frm.doc.purpose)) {
frm.add_custom_button(__('Bill of Materials'), function(){
frm.events.get_items_from_bom(frm);
}, __("Get items from"));
if (frm.doc.docstatus === 0 &&
['Material Issue', 'Material Receipt', 'Material Transfer', 'Send to Subcontractor'].includes(frm.doc.purpose)) {
frm.add_custom_button(__('Bill of Materials'), function() {
frm.events.get_items_from_bom(frm);
}, __("Get items from"));
}
},
@ -449,7 +449,7 @@ frappe.ui.form.on('Stock Entry', {
d.t_warehouse = values.target_warehouse;
d.uom = item.stock_uom;
d.stock_uom = item.stock_uom;
d.conversion_factor = 1;
d.conversion_factor = item.conversion_factor ? item.conversion_factor : 1;
d.qty = item.qty;
d.expense_account = item.expense_account;
d.project = item.project;