mirror of
https://github.com/frappe/books.git
synced 2024-12-25 12:10:06 +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,
|
extends: Autocomplete,
|
||||||
methods: {
|
methods: {
|
||||||
async getList(query) {
|
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({
|
const list = await frappe.db.getAll({
|
||||||
doctype: this.getTarget(),
|
doctype: this.getTarget(),
|
||||||
filters: query
|
filters,
|
||||||
? {
|
|
||||||
keywords: ['like', query]
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
fields: ['name'],
|
fields: ['name'],
|
||||||
limit: 50
|
limit: 50
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user