修改消耗与产出不一致的bug
This commit is contained in:
parent
9fd1e20008
commit
ab0c9e226f
|
@ -39,7 +39,8 @@ class Material(CommonAModel):
|
||||||
type = models.PositiveSmallIntegerField('物料类型', choices= type_choices, default=1)
|
type = models.PositiveSmallIntegerField('物料类型', choices= type_choices, default=1)
|
||||||
sort_str = models.CharField('排序字符', max_length=100, null=True, blank=True)
|
sort_str = models.CharField('排序字符', max_length=100, null=True, blank=True)
|
||||||
unit = models.CharField('基准计量单位', choices=unit_choices, default='块', max_length=10)
|
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)
|
piece_count = models.PositiveSmallIntegerField('单片玻璃数量', null=True, blank=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = '物料表'
|
verbose_name = '物料表'
|
||||||
|
|
|
@ -563,7 +563,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
omos = OperationMaterial.objects.filter(operation=op,
|
omos = OperationMaterial.objects.filter(operation=op,
|
||||||
type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
||||||
sps_omo_l = omos.filter(use_scrap=False).values_list('subproduction_plan', flat=True)
|
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
|
pass
|
||||||
else:
|
else:
|
||||||
raise exceptions.APIException('消耗与产出不一致')
|
raise exceptions.APIException('消耗与产出不一致')
|
||||||
|
|
Loading…
Reference in New Issue