diff --git a/rattail_demo/web/app.py b/rattail_demo/web/app.py
index 3efd877..e6e9895 100644
--- a/rattail_demo/web/app.py
+++ b/rattail_demo/web/app.py
@@ -15,6 +15,7 @@ def main(global_config, **settings):
"""
# prefer demo templates over tailbone
settings.setdefault('mako.directories', ['rattail_demo.web:templates',
+ 'tailbone_corepos:templates',
'tailbone:templates',])
# for graceful handling of postgres restart
diff --git a/rattail_demo/web/templates/products/view.mako b/rattail_demo/web/templates/products/view.mako
deleted file mode 100644
index 7aacafc..0000000
--- a/rattail_demo/web/templates/products/view.mako
+++ /dev/null
@@ -1,27 +0,0 @@
-## -*- coding: utf-8; -*-
-<%inherit file="tailbone:templates/products/view.mako" />
-
-<%def name="object_helpers()">
- ${parent.object_helpers()}
- ${self.render_xref_helper()}
-%def>
-
-<%def name="render_xref_helper()">
-
-
Cross-Reference
-
-
- View in CORE Office
-
-
-
-%def>
-
-
-${parent.body()}
diff --git a/rattail_demo/web/views/products.py b/rattail_demo/web/views/products.py
index 0dae70e..376a96c 100644
--- a/rattail_demo/web/views/products.py
+++ b/rattail_demo/web/views/products.py
@@ -3,18 +3,17 @@
Product views
"""
-from rattail_corepos.config import core_office_url
-
from tailbone.views import products as base
+from tailbone_corepos.views import products as corepos_base
-class ProductsView(base.ProductsView):
+class ProductView(corepos_base.ProductView):
"""
Product overrides for online demo
"""
def configure_form(self, f):
- super(ProductsView, self).configure_form(f)
+ super(ProductView, self).configure_form(f)
if self.editing:
f.fields = [
@@ -55,26 +54,6 @@ class ProductsView(base.ProductsView):
'deleted',
]
- def template_kwargs_view(self, **kwargs):
- """
- Supplements the default logic as follows:
-
- Adds the URL for viewing the product within CORE Office, or else the
- reason for lack of such a URL.
- """
- kwargs = super(ProductsView, self).template_kwargs_view(**kwargs)
- product = kwargs['instance']
-
- # CORE Office URL
- kwargs['core_office_url'] = None
- office_url = core_office_url(self.rattail_config)
- if not office_url:
- kwargs['core_office_why_no_url'] = "CORE Office URL is not configured!"
- else:
- kwargs['core_office_url'] = '{}/item/ItemEditorPage.php?searchupc={}'.format(office_url, product.item_id)
-
- return kwargs
-
def includeme(config):
@@ -86,4 +65,4 @@ def includeme(config):
config.add_view(base.print_labels, route_name='products.print_labels',
renderer='json', permission='products.print_labels')
- ProductsView.defaults(config)
+ ProductView.defaults(config)