feat: 修改物料清单默认排序

This commit is contained in:
caoqianming 2024-01-29 16:00:00 +08:00
parent 1a65e95127
commit 9ff3ee2040
1 changed files with 3 additions and 2 deletions

View File

@ -30,9 +30,10 @@ class MaterialViewSet(CustomModelViewSet):
search_fields = ['name', 'code', 'number', 'specification']
select_related_fields = ['process']
ordering = ['sort', 'id', 'number', 'name']
ordering_fields = ['sort', 'id', 'number', 'name', 'type', 'process']
ordering_fields = ['name', 'model', 'specification',
'type', 'process', 'process__sort', 'sort', 'id', 'number']
@action(methods=['post'], detail=False, serializer_class=Serializer)
@action(methods=['post'], detail=False, serializer_class=Serializer, perms_map={'post': 'material.create'})
@transaction.atomic
def daoru(self, request, *args, **kwargs):
"""导入物料