[fix] removed purchase order no from purchase list view, since it does not show purchase receipt when the form doesn't have any purchase receipt items

This commit is contained in:
Anand Doshi 2013-08-23 19:53:41 +05:30
parent 6c0a1a9674
commit cf343174a4

View File

@ -1,22 +0,0 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
// License: GNU General Public License v3. See license.txt
// render
wn.listview_settings['Purchase Receipt'] = {
add_fields: ["group_concat(`tabPurchase Receipt Item`.prevdoc_docname) \
as purchase_order_no"],
add_columns: [{"content":"purchase_order_no", width:"30%"}],
group_by: "`tabPurchase Receipt`.name",
prepare_data: function(data) {
if(data.purchase_order_no) {
data.purchase_order_no = $.unique(data.purchase_order_no.split(","));
var po_list = [];
$.each(data.purchase_order_no, function(i, v){
if(po_list.indexOf(v)==-1) po_list.push(
repl("<a href=\"#Form/Purchase Order/%(name)s\">%(name)s</a>",
{name: v}));
});
data.purchase_order_no = po_list.join(", ");
}
}
};