Highlight former Employee records as red/warning

This commit is contained in:
Lance Edgar 2019-08-03 17:18:53 -05:00
parent 1bb0330ab5
commit 69eb54abf6

View file

@ -141,6 +141,10 @@ class EmployeesView(MasterView):
q = q.filter(model.Employee.status == self.enum.EMPLOYEE_STATUS_CURRENT) q = q.filter(model.Employee.status == self.enum.EMPLOYEE_STATUS_CURRENT)
return q return q
def grid_extra_class(self, employee, i):
if employee.status == self.enum.EMPLOYEE_STATUS_FORMER:
return 'warning'
def editable_instance(self, employee): def editable_instance(self, employee):
if self.rattail_config.demo(): if self.rattail_config.demo():
return not bool(employee.user and employee.user.username == 'chuck') return not bool(employee.user and employee.user.username == 'chuck')