Cleanup attribute names for CORE Employee model
This commit is contained in:
parent
699900cbc5
commit
98ca1ec402
|
@ -38,48 +38,35 @@ class EmployeeView(CoreOfficeMasterView):
|
||||||
url_prefix = '/core-pos/employees'
|
url_prefix = '/core-pos/employees'
|
||||||
route_prefix = 'corepos.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 = [
|
grid_columns = [
|
||||||
'emp_no',
|
'number',
|
||||||
'FirstName',
|
'first_name',
|
||||||
'LastName',
|
'last_name',
|
||||||
'JobTitle',
|
'job_title',
|
||||||
'EmpActive',
|
'active',
|
||||||
'birthdate',
|
'birth_date',
|
||||||
]
|
]
|
||||||
|
|
||||||
def configure_grid(self, g):
|
def configure_grid(self, g):
|
||||||
super(EmployeeView, self).configure_grid(g)
|
super(EmployeeView, self).configure_grid(g)
|
||||||
|
|
||||||
g.filters['EmpActive'].default_active = True
|
g.filters['active'].default_active = True
|
||||||
g.filters['EmpActive'].default_verb = 'is_true'
|
g.filters['active'].default_verb = 'is_true'
|
||||||
|
|
||||||
g.filters['FirstName'].default_active = True
|
g.filters['first_name'].default_active = True
|
||||||
g.filters['FirstName'].default_verb = 'contains'
|
g.filters['first_name'].default_verb = 'contains'
|
||||||
|
|
||||||
g.filters['LastName'].default_active = True
|
g.filters['last_name'].default_active = True
|
||||||
g.filters['LastName'].default_verb = 'contains'
|
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('number')
|
||||||
g.set_link('FirstName')
|
g.set_link('first_name')
|
||||||
g.set_link('LastName')
|
g.set_link('last_name')
|
||||||
|
|
||||||
def grid_extra_class(self, employee, i):
|
def grid_extra_class(self, employee, i):
|
||||||
if not employee.EmpActive:
|
if not employee.active:
|
||||||
return 'warning'
|
return 'warning'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue