diff --git a/tailbone_corepos/views/corepos/__init__.py b/tailbone_corepos/views/corepos/__init__.py index dd894b4..198e27b 100644 --- a/tailbone_corepos/views/corepos/__init__.py +++ b/tailbone_corepos/views/corepos/__init__.py @@ -32,6 +32,7 @@ def includeme(config): config.include('tailbone_corepos.views.corepos.departments') config.include('tailbone_corepos.views.corepos.subdepartments') config.include('tailbone_corepos.views.corepos.vendors') + config.include('tailbone_corepos.views.corepos.origins') config.include('tailbone_corepos.views.corepos.products') config.include('tailbone_corepos.views.corepos.members') config.include('tailbone_corepos.views.corepos.customers') diff --git a/tailbone_corepos/views/corepos/origins.py b/tailbone_corepos/views/corepos/origins.py new file mode 100644 index 0000000..6ac4f2e --- /dev/null +++ b/tailbone_corepos/views/corepos/origins.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8; -*- +################################################################################ +# +# Rattail -- Retail Software Framework +# Copyright © 2010-2020 Lance Edgar +# +# This file is part of Rattail. +# +# Rattail is free software: you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# Rattail is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# Rattail. If not, see . +# +################################################################################ +""" +CORE-POS origin views +""" + +from corepos.db.office_op import model as corepos + +from .master import CoreOfficeMasterView + + +class OriginView(CoreOfficeMasterView): + """ + Base class for origin views. + """ + model_class = corepos.Origin + model_title = "CORE-POS Origin" + url_prefix = '/core-pos/origins' + route_prefix = 'corepos.origins' + + labels = { + 'country_id': "Country ID", + 'state_prov_id': "State/Province ID", + 'state_prov': "State/Province", + 'custom_id': "Custom Region ID", + } + + grid_columns = [ + 'id', + 'name', + 'short_name', + 'local', + 'country', + 'state_prov', + 'custom_region', + ] + + form_fields = [ + 'id', + 'name', + 'short_name', + 'local', + 'country', + 'state_prov', + 'custom_region', + ] + + +def includeme(config): + OriginView.defaults(config)