2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 19:39:07 +00:00

Get filters from docfield in Link

This commit is contained in:
Faris Ansari 2018-10-23 02:20:50 +05:30
parent b380812c57
commit 058011ebe9

View File

@ -10,13 +10,18 @@ export default {
extends: Autocomplete,
methods: {
async getList(query) {
let filters = this.docfield.getFilters ?
this.docfield.getFilters(query) :
null;
if (query) {
if (!filters) filters = {};
filters.keywords = ['like', query];
}
const list = await frappe.db.getAll({
doctype: this.getTarget(),
filters: query
? {
keywords: ['like', query]
}
: null,
filters,
fields: ['name'],
limit: 50
});