2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

update the hidden property for sidebar gstr reports

This commit is contained in:
Ankit Singhaniya 2021-12-15 00:13:09 +05:30 committed by Alan
parent 3f8e058066
commit 3bdbdbb73a
2 changed files with 4 additions and 9 deletions

View File

@ -131,7 +131,8 @@ export default {
if (group.items) {
group.items = await group.items.reduce(async (acc, item) => {
if (item.hidden) {
const hidden = await item.hidden();
// async methods can also be used in future
const hidden = item.hidden();
if (hidden) {
return acc;
} else {

View File

@ -98,18 +98,12 @@ const config = {
{
label: _('GSTR1'),
route: '/report/gstr-1',
hidden: async () => {
const { country } = await frappe.getSingle('AccountingSettings');
return country !== 'India';
},
hidden: () => frappe.AccountingSettings.country !== 'India',
},
{
label: _('GSTR2'),
route: '/report/gstr-2',
hidden: async () => {
const { country } = await frappe.getSingle('AccountingSettings');
return country !== 'India';
},
hidden: () => frappe.AccountingSettings.country !== 'India',
},
],
},