feat: add view for CORE Custom Receipt Lines (op.customReceipt)

This commit is contained in:
Lance Edgar 2024-08-06 10:39:33 -05:00
parent a7ff4e4ffc
commit 25d1eaa816
3 changed files with 57 additions and 1 deletions

View file

@ -202,6 +202,11 @@ def make_corepos_menu(request):
'route': 'corepos.tenders',
'perm': 'corepos.tenders.list',
},
{
'title': "Custom Receipt Lines",
'route': 'corepos.custom_receipt_lines',
'perm': 'corepos.custom_receipt_lines.list',
},
],
},
{

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2023 Lance Edgar
# Copyright © 2010-2024 Lance Edgar
#
# This file is part of Rattail.
#
@ -48,6 +48,7 @@ def defaults(config, **kwargs):
config.include(mod('tailbone_corepos.views.corepos.customers'))
config.include(mod('tailbone_corepos.views.corepos.employees'))
config.include(mod('tailbone_corepos.views.corepos.coupons'))
config.include(mod('tailbone_corepos.views.corepos.receipts'))
config.include(mod('tailbone_corepos.views.corepos.tenders'))
config.include(mod('tailbone_corepos.views.corepos.stockpurchases'))
config.include(mod('tailbone_corepos.views.corepos.taxrates'))

View file

@ -0,0 +1,50 @@
# -*- coding: utf-8; -*-
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2024 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 <http://www.gnu.org/licenses/>.
#
################################################################################
"""
CORE POS receipt views
"""
from corepos.db.office_op.model import CustomReceiptLine
from .master import CoreOfficeMasterView
class CustomReceiptLineView(CoreOfficeMasterView):
"""
Master view for custom receipt text
"""
model_class = CustomReceiptLine
model_title = "CORE-POS Custom Receipt Line"
route_prefix = 'corepos.custom_receipt_lines'
url_prefix = '/core-pos/custom-receipt-lines'
def defaults(config, **kwargs):
base = globals()
CustomReceiptLineView = kwargs.get('CustomReceiptLineView', base['CustomReceiptLineView'])
CustomReceiptLineView.defaults(config)
def includeme(config):
defaults(config)