Add views for CORE CustomerNotifications
table
This commit is contained in:
parent
0fe85e6df3
commit
44a7a762d4
|
@ -57,6 +57,11 @@ def make_corepos_menu(request):
|
|||
'route': 'corepos.customer_accounts_new',
|
||||
'perm': 'corepos.customer_accounts_new.list',
|
||||
},
|
||||
{
|
||||
'title': "Customer Notifications",
|
||||
'route': 'corepos.customer_notifications',
|
||||
'perm': 'corepos.customer_notifications.list',
|
||||
},
|
||||
{
|
||||
'title': "Suspensions",
|
||||
'route': 'corepos.suspensions',
|
||||
|
|
|
@ -237,6 +237,34 @@ class CustomerView(CoreOfficeMasterView):
|
|||
g.set_sort_defaults('card_number')
|
||||
|
||||
|
||||
class CustomerNotificationView(CoreOfficeMasterView):
|
||||
"""
|
||||
Master view for customers notifications
|
||||
"""
|
||||
model_class = corepos.CustomerNotification
|
||||
model_title = "CORE-POS Customer Notification"
|
||||
model_title_plural = "CORE-POS Customer Notifications"
|
||||
url_prefix = '/core-pos/customer-notifications'
|
||||
route_prefix = 'corepos.customer_notifications'
|
||||
|
||||
labels = {
|
||||
'customer_id': "Customer ID",
|
||||
}
|
||||
|
||||
def configure_grid(self, g):
|
||||
super().configure_grid(g)
|
||||
|
||||
g.set_link('id')
|
||||
g.set_sort_defaults('id', 'desc')
|
||||
|
||||
g.set_link('card_number')
|
||||
if 'card_number' in g.filters:
|
||||
g.filters['card_number'].default_active = True
|
||||
g.filters['card_number'].default_verb = 'equal'
|
||||
|
||||
g.set_link('message')
|
||||
|
||||
|
||||
class SuspensionView(CoreOfficeMasterView):
|
||||
"""
|
||||
Master view for legacy customer suspensions.
|
||||
|
@ -313,6 +341,9 @@ def defaults(config, **kwargs):
|
|||
CustomerView = kwargs.get('CustomerView', base['CustomerView'])
|
||||
CustomerView.defaults(config)
|
||||
|
||||
CustomerNotificationView = kwargs.get('CustomerNotificationView', base['CustomerNotificationView'])
|
||||
CustomerNotificationView.defaults(config)
|
||||
|
||||
SuspensionView = kwargs.get('SuspensionView', base['SuspensionView'])
|
||||
SuspensionView.defaults(config)
|
||||
|
||||
|
|
Loading…
Reference in a new issue