Use routes instead of urls, for menu definitions

This commit is contained in:
Lance Edgar 2022-08-22 16:51:41 -05:00
parent 0a150d2ae5
commit 1656a95066

View file

@ -41,30 +41,25 @@ def simple_menus(request):
'items': [
{
'title': "New Customer Order",
'url': url('custorders.create'),
'route': 'custorders.create',
'perm': 'custorders.create',
},
{
'title': "All New Orders",
'url': url('new_custorders'),
'route': 'new_custorders',
'perm': 'new_custorders.list',
},
{'type': 'sep'},
{
'title': "All Customer Orders",
'url': url('custorders'),
'route': 'custorders',
'perm': 'custorders.list',
},
{
'title': "All Order Items",
'url': url('custorders.items'),
'route': 'custorders.items',
'perm': 'custorders.items.list',
},
# {
# 'title': "Configuration",
# 'url': url('custorders.config'),
# 'perm': 'custorders.configure',
# },
],
}
@ -74,28 +69,28 @@ def simple_menus(request):
'items': [
{
'title': "Members",
'url': url('members'),
'route': 'members',
'perm': 'members.list',
},
{
'title': "Customers",
'url': url('customers'),
'route': 'customers',
'perm': 'customers.list',
},
{
'title': "Employees",
'url': url('employees'),
'route': 'employees',
'perm': 'employees.list',
},
{
'title': "All People",
'url': url('people'),
'route': 'people',
'perm': 'people.list',
},
{'type': 'sep'},
{
'title': "Pending Customers",
'url': url('pending_customers'),
'route': 'pending_customers',
'perm': 'pending_customers.list',
},
],
@ -107,38 +102,38 @@ def simple_menus(request):
'items': [
{
'title': "Products",
'url': url('products'),
'route': 'products',
'perm': 'products.list',
},
{
'title': "Departments",
'url': url('departments'),
'route': 'departments',
'perm': 'departments.list',
},
{
'title': "Subdepartments",
'url': url('subdepartments'),
'route': 'subdepartments',
'perm': 'subdepartments.list',
},
{
'title': "Brands",
'url': url('brands'),
'route': 'brands',
'perm': 'brands.list',
},
{
'title': "Taxes",
'url': url('taxes'),
'route': 'taxes',
'perm': 'taxes.list',
},
{
'title': "Units of Measure",
'url': url('uoms'),
'route': 'uoms',
'perm': 'uoms.list',
},
{'type': 'sep'},
{
'title': "Pending Products",
'url': url('pending_products'),
'route': 'pending_products',
'perm': 'pending_products.list',
},
],
@ -150,35 +145,35 @@ def simple_menus(request):
'items': [
{
'title': "Vendors",
'url': url('vendors'),
'route': 'vendors',
'perm': 'vendors.list',
},
{'type': 'sep'},
{
'title': "Ordering",
'url': url('ordering'),
'route': 'ordering',
'perm': 'ordering.list',
},
{
'title': "Receiving",
'url': url('receiving'),
'route': 'receiving',
'perm': 'receiving.list',
},
{'type': 'sep'},
{
'title': "Purchases",
'url': url('purchases'),
'route': 'purchases',
'perm': 'purchases.list',
},
{
'title': "Credits",
'url': url('purchases.credits'),
'route': 'purchases.credits',
'perm': 'purchases.credits.list',
},
{'type': 'sep'},
{
'title': "Catalog Batches",
'url': url('vendorcatalogs'),
'route': 'vendorcatalogs',
'perm': 'vendorcatalogs.list',
},
],
@ -209,24 +204,24 @@ def simple_menus(request):
'items': [
{
'title': "New Report",
'url': url('report_output.create'),
'route': 'report_output.create',
'perm': 'report_output.create',
},
{
'title': "Generated Reports",
'url': url('report_output'),
'route': 'report_output',
'perm': 'report_output.list',
},
{'type': 'sep'},
{
'title': "Trainwreck",
'url': url('trainwreck.transactions'),
'route': 'trainwreck.transactions',
'perm': 'trainwreck.transactions.list',
},
{'type': 'sep'},
{
'title': "Problem Reports",
'url': url('problem_reports'),
'route': 'problem_reports',
'perm': 'problem_reports.list',
},
],
@ -238,48 +233,48 @@ def simple_menus(request):
'items': [
{
'title': "Stores",
'url': url('stores'),
'route': 'stores',
'perm': 'stores.list',
},
{
'title': "Users",
'url': url('users'),
'route': 'users',
'perm': 'users.list',
},
{
'title': "User Events",
'url': url('userevents'),
'route': 'userevents',
'perm': 'userevents.list',
},
{
'title': "Roles",
'url': url('roles'),
'route': 'roles',
'perm': 'roles.list',
},
{
'title': "Raw Permissions",
'url': url('permissions'),
'route': 'permissions',
'perm': 'permissions.list',
},
{'type': 'sep'},
{
'title': "App Settings",
'url': url('appsettings'),
'route': 'appsettings',
'perm': 'settings.list',
},
{
'title': "Email Settings",
'url': url('emailprofiles'),
'route': 'emailprofiles',
'perm': 'emailprofiles.list',
},
{
'title': "Email Attempts",
'url': url('email_attempts'),
'route': 'email_attempts',
'perm': 'email_attempts.list',
},
{
'title': "Raw Settings",
'url': url('settings'),
'route': 'settings',
'perm': 'settings.list',
},
{'type': 'sep'},
@ -295,7 +290,7 @@ def simple_menus(request):
},
{
'title': "Importing / Exporting",
'url': url('importing'),
'route': 'importing',
'perm': 'importing.list',
},
{
@ -305,12 +300,12 @@ def simple_menus(request):
},
{
'title': "Tables",
'url': url('tables'),
'route': 'tables',
'perm': 'tables.list',
},
{
'title': "Theo Upgrades",
'url': url('upgrades'),
'title': "Upgrades",
'route': 'upgrades',
'perm': 'upgrades.list',
},
],