2
0
mirror of https://github.com/frappe/books.git synced 2024-11-08 23:00:56 +00:00

overrride link filters

This commit is contained in:
Rushabh Mehta 2018-01-23 18:17:56 +05:30
parent 44c171db79
commit 1c9b43225b
2 changed files with 47 additions and 20 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,12 +4,21 @@ class account_meta extends frappe.meta.Meta {
setup_meta() {
Object.assign(this, require('./account.json'));
this.list_options.fields = ['name', 'account_type'];
this.setup_links();
}
setup_links() {
this.get_field('parent_account').get_filters = function(query) {
return {
keywords: ["like", query],
name: ["!=", this.form.doc.name]
}
}
}
get_row_html(data) {
return `<a href="#edit/account/${data.name}">${data.name} (${data.account_type})</a>`;
}
}
class account extends frappe.document.Document {