Add views for CORE-POS members

This commit is contained in:
Lance Edgar 2019-03-06 18:24:00 -06:00
parent b1875f5834
commit b0b7fc42b9
3 changed files with 60 additions and 0 deletions

View file

@ -127,6 +127,16 @@ def simple_menus(request):
'url': url('corepos.customers'),
'perm': 'corepos.customers.list',
},
{
'title': "Member Types",
'url': url('corepos.member_types'),
'perm': 'corepos.member_types.list',
},
{
'title': "Members",
'url': url('corepos.members'),
'perm': 'corepos.members.list',
},
{
'title': "Employees",
'url': url('corepos.employees'),

View file

@ -13,6 +13,7 @@ def includeme(config):
config.include('rattail_demo.web.views.corepos.subdepartments')
config.include('rattail_demo.web.views.corepos.vendors')
config.include('rattail_demo.web.views.corepos.products')
config.include('rattail_demo.web.views.corepos.members')
config.include('rattail_demo.web.views.corepos.customers')
config.include('rattail_demo.web.views.corepos.employees')
config.include('rattail_demo.web.views.corepos.transactions')

View file

@ -0,0 +1,49 @@
# -*- coding: utf-8; -*-
"""
CORE-POS member views
"""
from __future__ import unicode_literals, absolute_import
from corepos.db import model as corepos
from .master import CoreMasterView
class MemberTypeView(CoreMasterView):
"""
Master view for member types
"""
model_class = corepos.MemberType
model_title = "CORE-POS Member Type"
url_prefix = '/core-pos/member-types'
route_prefix = 'corepos.member_types'
labels = {
'memtype': "Type",
'memDesc': "Description",
'custdataType': "Cust. Data Type",
'ssi': "SSI",
'salesCode': "Sales Code",
}
def configure_grid(self, g):
super(MemberTypeView, self).configure_grid(g)
g.set_link('memtype')
g.set_link('memDesc')
class MemberView(CoreMasterView):
"""
Master view for members
"""
model_class = corepos.MemberInfo
model_title = "CORE-POS Member"
url_prefix = '/core-pos/members'
route_prefix = 'corepos.members'
def includeme(config):
MemberTypeView.defaults(config)
MemberView.defaults(config)