From ab0c9e226fbc7854b261a4c86637955bbee07cb1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 6 Jan 2022 09:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B6=88=E8=80=97=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=87=BA=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/mtm/models.py | 3 ++- hb_server/apps/sam/filters.py | 0 hb_server/apps/wpm/views.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 hb_server/apps/sam/filters.py diff --git a/hb_server/apps/mtm/models.py b/hb_server/apps/mtm/models.py index 7815711..b7b99c2 100644 --- a/hb_server/apps/mtm/models.py +++ b/hb_server/apps/mtm/models.py @@ -39,7 +39,8 @@ class Material(CommonAModel): type = models.PositiveSmallIntegerField('物料类型', choices= type_choices, default=1) sort_str = models.CharField('排序字符', max_length=100, null=True, blank=True) unit = models.CharField('基准计量单位', choices=unit_choices, default='块', max_length=10) - count = models.IntegerField('物料总数', default=0) + count = models.PositiveIntegerField('物料库存总数', default=0) + count_safe = models.PositiveIntegerField('安全库存总数', null=True, blank=True) piece_count = models.PositiveSmallIntegerField('单片玻璃数量', null=True, blank=True) class Meta: verbose_name = '物料表' diff --git a/hb_server/apps/sam/filters.py b/hb_server/apps/sam/filters.py new file mode 100644 index 0000000..e69de29 diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 09d144d..d0e0986 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -563,7 +563,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd omos = OperationMaterial.objects.filter(operation=op, type=SubprodctionMaterial.SUB_MA_TYPE_OUT) sps_omo_l = omos.filter(use_scrap=False).values_list('subproduction_plan', flat=True) - if set(list(sps_omi_l)) == set(list(sps_omo_l)): + if set(list(sps_omi_l)) == set(list(sps_omo_l)) or op.step.type == Step.STEP_TYPE_COMB: pass else: raise exceptions.APIException('消耗与产出不一致')