sort positions
This commit is contained in:
parent
94272609bf
commit
223f5217a2
|
|
@ -427,8 +427,8 @@ class EstEmployeeBackSerializer(EmployeeBackSerializers):
|
||||||
es_emp = EstablishmentEmployee.objects.filter(
|
es_emp = EstablishmentEmployee.objects.filter(
|
||||||
employee=obj,
|
employee=obj,
|
||||||
establishment_id=establishment_id,
|
establishment_id=establishment_id,
|
||||||
).distinct().order_by('position_id').prefetch_related('position', 'position__establishment_type',
|
).distinct().order_by('from_date').prefetch_related('position', 'position__establishment_type',
|
||||||
'position__establishment_subtype')
|
'position__establishment_subtype')
|
||||||
result = []
|
result = []
|
||||||
for item in es_emp:
|
for item in es_emp:
|
||||||
if item.position.establishment_type == establishment_type or \
|
if item.position.establishment_type == establishment_type or \
|
||||||
|
|
@ -445,7 +445,6 @@ class EstEmployeeBackSerializer(EmployeeBackSerializers):
|
||||||
'position_index_name': item.position.index_name,
|
'position_index_name': item.position.index_name,
|
||||||
'position_name_translated': item.position.name_translated,
|
'position_name_translated': item.position.name_translated,
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user