Cleanup attribute names for CORE Employee model

This commit is contained in:
Lance Edgar 2019-08-14 21:03:06 -05:00
parent 699900cbc5
commit 98ca1ec402

View file

@ -38,48 +38,35 @@ class EmployeeView(CoreOfficeMasterView):
url_prefix = '/core-pos/employees'
route_prefix = 'corepos.employees'
labels = {
'emp_no': "Number",
'CashierPassword': "Cashier Password",
'AdminPassword': "Admin Password",
'FirstName': "First Name",
'LastName': "Last Name",
'JobTitle': "Job Title",
'EmpActive': "Active",
'frontendsecurity': "Frontend Security",
'backendsecurity': "Backend Security",
'birthdate': "Birth Date",
}
grid_columns = [
'emp_no',
'FirstName',
'LastName',
'JobTitle',
'EmpActive',
'birthdate',
'number',
'first_name',
'last_name',
'job_title',
'active',
'birth_date',
]
def configure_grid(self, g):
super(EmployeeView, self).configure_grid(g)
g.filters['EmpActive'].default_active = True
g.filters['EmpActive'].default_verb = 'is_true'
g.filters['active'].default_active = True
g.filters['active'].default_verb = 'is_true'
g.filters['FirstName'].default_active = True
g.filters['FirstName'].default_verb = 'contains'
g.filters['first_name'].default_active = True
g.filters['first_name'].default_verb = 'contains'
g.filters['LastName'].default_active = True
g.filters['LastName'].default_verb = 'contains'
g.filters['last_name'].default_active = True
g.filters['last_name'].default_verb = 'contains'
g.set_sort_defaults('emp_no')
g.set_sort_defaults('number')
g.set_link('emp_no')
g.set_link('FirstName')
g.set_link('LastName')
g.set_link('number')
g.set_link('first_name')
g.set_link('last_name')
def grid_extra_class(self, employee, i):
if not employee.EmpActive:
if not employee.active:
return 'warning'