子工序检验可不复用表
This commit is contained in:
parent
1784a066d0
commit
0b0fab4b0a
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.9 on 2022-06-27 05:10
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mtm', '0053_alter_material_unit'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='usedstep',
|
||||
name='reuse_form',
|
||||
field=models.BooleanField(default=True, verbose_name='复用上表'),
|
||||
),
|
||||
]
|
|
@ -51,7 +51,6 @@ class WpmService(object):
|
|||
"""
|
||||
is_testok = test.is_testok
|
||||
wproduct = test.wproduct
|
||||
test_i = None
|
||||
if is_testok:
|
||||
if wproduct.act_state == WProduct.WPR_ACT_STATE_TORETEST: # 复检
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||
|
@ -63,7 +62,6 @@ class WpmService(object):
|
|||
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOTEST and \
|
||||
test.is_midtesting is True:
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||
test_i = test
|
||||
|
||||
elif wproduct.act_state == WProduct.WPR_ACT_STATE_TOTEST and wproduct.material.type == Material.MA_TYPE_GOOD: # 成品检验
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_TOFINALTEST
|
||||
|
@ -113,7 +111,7 @@ class WpmService(object):
|
|||
|
||||
wproduct.update_by = user
|
||||
wproduct.update_time = timezone.now()
|
||||
wproduct.test = test_i
|
||||
wproduct.test = None
|
||||
wproduct.last_test_result = is_testok
|
||||
wproduct.save()
|
||||
# 添加日志
|
||||
|
|
|
@ -771,7 +771,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
|||
wproduct.subproduction_plan = oms_w.subproduction_plan
|
||||
if step == newstep:
|
||||
wproduct.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
||||
if wproduct.test:# 如果有正在进行的工序中检验
|
||||
if wproduct.test: # 如果有正在进行的工序中检验
|
||||
if reuseForm:
|
||||
wproduct.test.is_midtesting = False
|
||||
wproduct.test.is_submited = False
|
||||
|
|
Loading…
Reference in New Issue