diff --git a/hb_server/apps/mtm/migrations/0054_usedstep_reuse_form.py b/hb_server/apps/mtm/migrations/0054_usedstep_reuse_form.py new file mode 100644 index 0000000..1b803dc --- /dev/null +++ b/hb_server/apps/mtm/migrations/0054_usedstep_reuse_form.py @@ -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='复用上表'), + ), + ] diff --git a/hb_server/apps/wpm/services.py b/hb_server/apps/wpm/services.py index 821d2de..42de513 100644 --- a/hb_server/apps/wpm/services.py +++ b/hb_server/apps/wpm/services.py @@ -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() # 添加日志 diff --git a/hb_server/apps/wpm/views.py b/hb_server/apps/wpm/views.py index 4f7d492..80fee33 100644 --- a/hb_server/apps/wpm/views.py +++ b/hb_server/apps/wpm/views.py @@ -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