mirror of
https://github.com/frappe/books.git
synced 2024-12-24 11:55:46 +00:00
Get filters from docfield in Link
This commit is contained in:
parent
b380812c57
commit
058011ebe9
@ -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
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user