diff --git a/src/router.js b/src/router.js index 906bb636..4de8ba4e 100644 --- a/src/router.js +++ b/src/router.js @@ -54,7 +54,7 @@ const routes = [ }, }, { - path: '/list/:doctype', + path: '/list/:doctype/:fieldname?/:value?', name: 'ListView', components: { default: ListView, @@ -62,7 +62,11 @@ const routes = [ }, props: { default: (route) => { - const { doctype, filters } = route.params; + let { doctype, filters, fieldname, value } = route.params; + if (filters === undefined && fieldname && value) { + filters = { [fieldname]: value }; + } + return { doctype, filters, diff --git a/src/sidebarConfig.js b/src/sidebarConfig.js index cbeb148f..5b975b8f 100644 --- a/src/sidebarConfig.js +++ b/src/sidebarConfig.js @@ -33,6 +33,11 @@ const config = { route: '/list/Customer', doctype: 'Customer', }, + { + label: t`Sales Items`, + route: '/list/Item/for/sales', + doctype: 'Item', + }, ], }, { @@ -50,18 +55,18 @@ const config = { route: '/list/Supplier', doctype: 'Supplier', }, + { + label: t`Purchase Items`, + route: '/list/Item/for/purchases', + doctype: 'Item', + }, ], }, { icon: 'common-entries', title: t`Common`, - route: '/list/Item', + route: '/list/Payment', items: [ - { - label: t`Items`, - route: '/list/Item', - doctype: 'Item', - }, { label: t`Payments`, route: '/list/Payment', @@ -72,6 +77,11 @@ const config = { route: '/list/JournalEntry', doctype: 'JournalEntry', }, + { + label: t`Common Items`, + route: '/list/Item/for/both', + doctype: 'Item', + }, ], }, {