show child table values in doclistview
diff --git a/erpnext/stock/doctype/purchase_receipt/listview.js b/erpnext/stock/doctype/purchase_receipt/listview.js
index c1b8b42..9155657 100644
--- a/erpnext/stock/doctype/purchase_receipt/listview.js
+++ b/erpnext/stock/doctype/purchase_receipt/listview.js
@@ -4,16 +4,27 @@
this._super(d);
this.fields = this.fields.concat([
"`tabPurchase Receipt`.supplier_name",
- "`tabPurchase Receipt`.purchase_order_no"
+ "group_concat(`tabPurchase Receipt Item`.prevdoc_docname) as purchase_order_no",
]);
},
+ prepare_data: function(data) {
+ this._super(data);
+ if(data.purchase_order_no) {
+ data.purchase_order_no = 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(v);
+ });
+ data.purchase_order_no = po_list.join(", ");
+ }
+ },
columns: [
{width: '3%', content: 'check'},
{width: '5%', content:'avatar'},
{width: '3%', content:'docstatus'},
{width: '15%', content:'name'},
- {width: '47%', content:'supplier_name+tags', css: {color:'#222'}},
- {width: '15%', content:'purchase_order_no', type:'link', doctype:'Purchase Order'},
+ {width: '32%', content:'supplier_name+tags', css: {color:'#222'}},
+ {width: '30%', content:'purchase_order_no'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
});