Register integration menu via provider

This commit is contained in:
Lance Edgar 2023-01-14 19:06:32 -06:00
parent c871d21b2c
commit 29d9654023
3 changed files with 38 additions and 30 deletions

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2022 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -28,7 +28,6 @@ from rattail_corepos.config import core_office_url
def make_corepos_menu(request):
url = request.route_url
corepos_menu = {
'title': "CORE-POS",
@ -40,37 +39,37 @@ def make_corepos_menu(request):
'items': [
{
'title': "Customers (Legacy)",
'url': url('corepos.customers'),
'route': 'corepos.customers',
'perm': 'corepos.customers.list',
},
{
'title': "Members (Legacy)",
'url': url('corepos.members'),
'route': 'corepos.members',
'perm': 'corepos.members.list',
},
{
'title': "Suspensions",
'url': url('corepos.suspensions'),
'route': 'corepos.suspensions',
'perm': 'corepos.suspensions.list',
},
{
'title': "Member Types",
'url': url('corepos.member_types'),
'route': 'corepos.member_types',
'perm': 'corepos.member_types.list',
},
{
'title': "Employees",
'url': url('corepos.employees'),
'route': 'corepos.employees',
'perm': 'corepos.employees.list',
},
{
'title': "Users",
'url': url('corepos.users'),
'route': 'corepos.users',
'perm': 'corepos.users.list',
},
{
'title': "User Groups",
'url': url('corepos.user_groups'),
'route': 'corepos.user_groups',
'perm': 'corepos.user_groups.list',
},
],
@ -81,54 +80,54 @@ def make_corepos_menu(request):
'items': [
{
'title': "Products",
'url': url('corepos.products'),
'route': 'corepos.products',
'perm': 'corepos.products.list',
},
{
'title': "Product Flags",
'url': url('corepos.product_flags'),
'route': 'corepos.product_flags',
'perm': 'corepos.product_flags.list',
},
{
'title': "Like Codes",
'url': url('corepos.like_codes'),
'route': 'corepos.like_codes',
'perm': 'corepos.like_codes.list',
},
{
'title': "Scale Items",
'url': url('corepos.scale_items'),
'route': 'corepos.scale_items',
'perm': 'corepos.scale_items.list',
},
{
'title': "Origins",
'url': url('corepos.origins'),
'route': 'corepos.origins',
'perm': 'corepos.origins.list',
},
{'type': 'sep'},
{
'title': "Super Departments",
'url': url('corepos.super_departments'),
'route': 'corepos.super_departments',
'perm': 'corepos.super_departments.list',
},
{
'title': "Departments",
'url': url('corepos.departments'),
'route': 'corepos.departments',
'perm': 'corepos.departments.list',
},
{
'title': "Subdepartments",
'url': url('corepos.subdepartments'),
'route': 'corepos.subdepartments',
'perm': 'corepos.subdepartments.list',
},
{'type': 'sep'},
{
'title': "Batches",
'url': url('corepos.batches'),
'route': 'corepos.batches',
'perm': 'corepos.batches.list',
},
{
'title': "Batch Types",
'url': url('corepos.batch_types'),
'route': 'corepos.batch_types',
'perm': 'corepos.batch_types.list',
},
],
@ -139,17 +138,17 @@ def make_corepos_menu(request):
'items': [
{
'title': "Vendors",
'url': url('corepos.vendors'),
'route': 'corepos.vendors',
'perm': 'corepos.vendors.list',
},
{
'title': "Vendor Items",
'url': url('corepos.vendor_items'),
'route': 'corepos.vendor_items',
'perm': 'corepos.vendor_items.list',
},
{
'title': "Purchase Orders",
'url': url('corepos.purchase_orders'),
'route': 'corepos.purchase_orders',
'perm': 'corepos.purchase_orders.list',
},
],
@ -160,17 +159,17 @@ def make_corepos_menu(request):
'items': [
{
'title': "Tax Rates",
'url': url('corepos.taxrates'),
'route': 'corepos.taxrates',
'perm': 'corepos.taxrates.list',
},
{
'title': "House Coupons",
'url': url('corepos.house_coupons'),
'route': 'corepos.house_coupons',
'perm': 'corepos.house_coupons.list',
},
{
'title': "Transaction Details",
'url': url('corepos.transaction_details'),
'route': 'corepos.transaction_details',
'perm': 'corepos.transaction_details.list',
},
],
@ -181,17 +180,17 @@ def make_corepos_menu(request):
'items': [
{
'title': "Stores",
'url': url('corepos.stores'),
'route': 'corepos.stores',
'perm': 'corepos.stores.list',
},
{
'title': "Parameters",
'url': url('corepos.parameters'),
'route': 'corepos.parameters',
'perm': 'corepos.parameters.list',
},
{
'title': "Table Sync Rules",
'url': url('corepos.table_sync_rules'),
'route': 'corepos.table_sync_rules',
'perm': 'corepos.table_sync_rules.list',
},
],

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2022 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -152,3 +152,7 @@ class TailboneCorePosProvider(TailboneProvider):
},
},
}
def make_integration_menu(self, request, **kwargs):
from tailbone_corepos.menus import make_corepos_menu
return make_corepos_menu(request)

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2022 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -26,6 +26,8 @@ Web Views
def includeme(config):
# native view supplements
config.include('tailbone_corepos.views.customers')
config.include('tailbone_corepos.views.departments')
config.include('tailbone_corepos.views.members')
@ -34,3 +36,6 @@ def includeme(config):
config.include('tailbone_corepos.views.stores')
config.include('tailbone_corepos.views.subdepartments')
config.include('tailbone_corepos.views.vendors')
# CORE-POS tables
config.include('tailbone_corepos.views.corepos')