From e8526135672cb014b8a09e9ca3c21163e970f32e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 10 Feb 2022 11:16:39 -0600 Subject: [PATCH] Add highlight for non-active customers in grid --- tailbone/views/customers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tailbone/views/customers.py b/tailbone/views/customers.py index c9bfacb9..b4dd77c6 100644 --- a/tailbone/views/customers.py +++ b/tailbone/views/customers.py @@ -131,12 +131,20 @@ class CustomerView(MasterView): g.set_sorter('person', model.Person.display_name) g.set_renderer('person', self.grid_render_person) + # active_in_pos + g.filters['active_in_pos'].default_active = True + g.filters['active_in_pos'].default_verb = 'is_true' + g.set_link('id') g.set_link('number') g.set_link('name') g.set_link('person') g.set_link('email') + def grid_extra_class(self, customer, i): + if not customer.active_in_pos: + return 'warning' + def get_instance(self): try: instance = super(CustomerView, self).get_instance()