From 865bf1f60ed55f3ce0923961ccd4ff19271d3788 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Wed, 11 Dec 2019 17:54:02 +0530 Subject: [PATCH] fix: Set filters from route in ListView --- models/doctype/Party/Customer.js | 5 +++-- src/pages/ListView/ListView.vue | 2 +- src/router.js | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/models/doctype/Party/Customer.js b/models/doctype/Party/Customer.js index 4dd37c0c..07b14b89 100644 --- a/models/doctype/Party/Customer.js +++ b/models/doctype/Party/Customer.js @@ -31,8 +31,9 @@ module.exports = { condition: doc => !doc.isNew(), action: customer => { router.push({ - path: `/list/SalesInvoice`, - query: { + name: 'ListView', + params: { + doctype: 'SalesInvoice', filters: { customer: customer.name } diff --git a/src/pages/ListView/ListView.vue b/src/pages/ListView/ListView.vue index 85d92538..08d9eb15 100644 --- a/src/pages/ListView/ListView.vue +++ b/src/pages/ListView/ListView.vue @@ -46,7 +46,7 @@ export default { Icon, FilterDropdown }, - mounted() { + activated() { if (typeof this.filters === 'object') { this.$refs.filterDropdown.setFilter(this.filters); } diff --git a/src/router.js b/src/router.js index 46448a6d..c121a878 100644 --- a/src/router.js +++ b/src/router.js @@ -54,10 +54,10 @@ const routes = [ }, props: { default: route => { - const { doctype } = route.params; + const { doctype, filters } = route.params; return { doctype, - filters: route.query.filters + filters }; }, edit: route => route.query