Fix config defaults for PurchaseView

so can customize that more easily
This commit is contained in:
Lance Edgar 2021-02-01 17:15:39 -06:00
parent 1cdb11c88c
commit 0209957def

View file

@ -355,21 +355,23 @@ class PurchaseView(MasterView):
@classmethod
def defaults(cls, config):
cls._purchase_defaults(config)
cls._defaults(config)
@classmethod
def _purchase_defaults(cls, config):
route_prefix = cls.get_route_prefix()
url_prefix = cls.get_url_prefix()
permission_prefix = cls.get_permission_prefix()
model_key = cls.get_model_key()
model_title = cls.get_model_title()
cls._defaults(config)
# receiving worksheet
config.add_tailbone_permission(permission_prefix, '{}.receiving_worksheet'.format(permission_prefix),
"Print receiving worksheet for {}".format(model_title))
config.add_route('{}.receiving_worksheet'.format(route_prefix), '{}/{{{}}}/receiving-worksheet'.format(url_prefix, model_key))
config.add_view(cls, attr='receiving_worksheet', route_name='{}.receiving_worksheet'.format(route_prefix),
permission='{}.receiving_worksheet'.format(permission_prefix))
def includeme(config):