From 9ff3ee204085f6e970a951536ade67cd45e6acd8 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 29 Jan 2024 16:00:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E9=BB=98=E8=AE=A4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mtm/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/mtm/views.py b/apps/mtm/views.py index dc81766e..19c80f07 100644 --- a/apps/mtm/views.py +++ b/apps/mtm/views.py @@ -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): """导入物料