Check Meta before Toggling Conversion Factor (#12237)

If it has been customized so as to set the conversion factor to read only, `toggle_conversion_factor` should respect that setting.
This commit is contained in:
Javier Wong 2017-12-29 16:36:47 +08:00 committed by Nabin Hait
parent df0dd8be5f
commit 2469095a13

View File

@ -693,7 +693,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
// toggle read only property for conversion factor field if the uom and stock uom are same
if(this.frm.get_field('items').grid.fields_map.conversion_factor) {
this.frm.fields_dict.items.grid.toggle_enable("conversion_factor",
(item.uom != item.stock_uom)? true: false);
((item.uom != item.stock_uom) && !frappe.meta.get_docfield(cur_frm.fields_dict.items.grid.doctype, "conversion_factor").read_only)? true: false);
}
},