Standard to be added if it is not default

This commit is contained in:
Anand Doshi 2012-12-10 13:35:41 +05:30
parent 1f8caf4a33
commit d102e0ab33

View file

@ -57,10 +57,8 @@ $.extend(wn.meta, {
if(locals.DocType[doctype].default_print_format)
print_format_list.push(locals.DocType[doctype].default_print_format)
print_format_list.push("Standard");
var print_formats = wn.model.get("Print Format", {doc_type: doctype})
.sort(function(a, b) { return (a > b) ? 1 : -1; });
var print_formats = ["Standard"].concat(wn.model.get("Print Format",
{doc_type: doctype}).sort(function(a, b) { return (a > b) ? 1 : -1; }));
$.each(print_formats, function(i, d) {
if(!in_list(print_format_list, d.name))
print_format_list.push(d.name);