minor fix in get_value

This commit is contained in:
Nabin Hait 2014-06-12 18:08:25 +05:30
parent ff71fa4da2
commit 2eae4a7740

View file

@ -212,9 +212,8 @@ $.extend(frappe.model, {
},
get_value: function(doctype, filters, fieldname) {
if(typeof filters==="string") {
return locals[doctype] && locals[doctype][filters]
&& locals[doctype][filters][fieldname];
if(typeof filters==="string" && locals[doctype] && locals[doctype][filters]) {
return locals[doctype][filters][fieldname];
} else {
var l = frappe.get_list(doctype, filters);
return (l.length && l[0]) ? l[0][fieldname] : null;