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('消耗与产出不一致')