2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00

Add title field to Link.vue

This commit is contained in:
Prssanna Desai 2019-02-27 12:48:30 +05:30
parent 9053f4a710
commit 4f8c546a62

View File

@ -19,10 +19,13 @@ export default {
filters.keywords = ['like', query]; filters.keywords = ['like', query];
} }
let target = this.getTarget();
let titleField = frappe.getMeta(target).titleField;
const list = await frappe.db.getAll({ const list = await frappe.db.getAll({
doctype: this.getTarget(), doctype: target,
filters, filters,
fields: ['name'], fields: ['name', titleField],
limit: 50 limit: 50
}); });
@ -34,7 +37,7 @@ export default {
return list return list
.map(d => ({ .map(d => ({
label: d.name, label: d[titleField],
value: d.name value: d.name
})) }))
.concat({ .concat({