Add views, menu for Trainwreck

This commit is contained in:
Lance Edgar 2021-02-17 20:22:39 -06:00
parent 2ec18e9e79
commit 61a16f2400
3 changed files with 22 additions and 1 deletions

View file

@ -41,6 +41,9 @@ class TheoConfig(ConfigExtension):
# Theo comes with its own menu for web app
config.setdefault('tailbone', 'menus', 'theo.web.menus')
# Trainwreck model is same regardless of POS
config.setdefault('rattail.trainwreck', 'model', 'rattail.trainwreck.db.model.defaults')
# do we integrate w/ CORE-POS?
if integrate_corepos(config):
config.setdefault('rattail', 'model', 'theo.db.model_corepos')

View file

@ -205,6 +205,18 @@ def simple_menus(request):
],
}
trainwreck_menu = {
'title': "Trainwreck",
'type': 'menu',
'items': [
{
'title': "Transactions",
'url': url('trainwreck.transactions'),
'perm': 'trainwreck.transactions.list',
},
],
}
admin_menu = {
'title': "Admin",
'type': 'menu',
@ -274,7 +286,6 @@ def simple_menus(request):
people_menu,
products_menu,
vendors_menu,
reporting_menu,
]
if include_catapult:
@ -284,7 +295,11 @@ def simple_menus(request):
if include_locsms:
menus.append(locsms_menu)
if rattail_config.trainwreck_engine:
menus.append(trainwreck_menu)
menus.extend([
reporting_menu,
admin_menu,
])

View file

@ -56,6 +56,9 @@ def includeme(config):
config.include('tailbone.views.purchasing')
config.include('tailbone.views.batch.vendorcatalog')
# trainwreck
config.include('tailbone.views.trainwreck.defaults')
# do we integrate w/ Catapult?
if integrate_catapult(rattail_config):
config.include('tailbone_onager.views.stores')