show child table values in doclistview
This commit is contained in:
parent
ebe23b0f89
commit
e9a21cbb85
@ -4,16 +4,27 @@ wn.doclistviews['Purchase Receipt'] = wn.views.ListView.extend({
|
|||||||
this._super(d);
|
this._super(d);
|
||||||
this.fields = this.fields.concat([
|
this.fields = this.fields.concat([
|
||||||
"`tabPurchase Receipt`.supplier_name",
|
"`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: [
|
columns: [
|
||||||
{width: '3%', content: 'check'},
|
{width: '3%', content: 'check'},
|
||||||
{width: '5%', content:'avatar'},
|
{width: '5%', content:'avatar'},
|
||||||
{width: '3%', content:'docstatus'},
|
{width: '3%', content:'docstatus'},
|
||||||
{width: '15%', content:'name'},
|
{width: '15%', content:'name'},
|
||||||
{width: '47%', content:'supplier_name+tags', css: {color:'#222'}},
|
{width: '32%', content:'supplier_name+tags', css: {color:'#222'}},
|
||||||
{width: '15%', content:'purchase_order_no', type:'link', doctype:'Purchase Order'},
|
{width: '30%', content:'purchase_order_no'},
|
||||||
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user