最后提交的本产品本工序自检 bug
This commit is contained in:
parent
0fb897d75b
commit
4024fee865
|
@ -139,9 +139,9 @@ class WProduct(CommonAModel):
|
||||||
@property
|
@property
|
||||||
def last_wp_test(self):
|
def last_wp_test(self):
|
||||||
"""
|
"""
|
||||||
最后提交的本产品工序自检
|
最后提交的本产品本工序自检
|
||||||
"""
|
"""
|
||||||
return self.test_wproduct.filter(is_submited=True).order_by('-id').first()
|
return self.test_wproduct.filter(is_submited=True, type=TestRecord.TEST_PROCESS, subproduction_plan=self.subproduction_plan).order_by('-id').first()
|
||||||
|
|
||||||
|
|
||||||
class WprouctTicket(CommonAModel):
|
class WprouctTicket(CommonAModel):
|
||||||
|
|
|
@ -203,7 +203,7 @@ class WProductViewSet(ListModelMixin, RetrieveModelMixin, GenericViewSet):
|
||||||
form=form)
|
form=form)
|
||||||
if wproduct.act_state == WProduct.WPR_ACT_STATE_TORETEST:
|
if wproduct.act_state == WProduct.WPR_ACT_STATE_TORETEST:
|
||||||
# 查找最近一条检验记录
|
# 查找最近一条检验记录
|
||||||
trs = wproduct.last_process_test
|
trs = wproduct.last_wp_test
|
||||||
savedict['origin_test'] = trs
|
savedict['origin_test'] = trs
|
||||||
if not trs:
|
if not trs:
|
||||||
raise exceptions.APIException('原工序检验记录不存在')
|
raise exceptions.APIException('原工序检验记录不存在')
|
||||||
|
@ -707,7 +707,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
|
|
||||||
if step == newstep:
|
if step == newstep:
|
||||||
wp.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
wp.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
||||||
last_test = wp.last_process_test
|
last_test = wp.last_wp_test
|
||||||
if last_test and reuseForm:
|
if last_test and reuseForm:
|
||||||
last_test.is_midtesting = False
|
last_test.is_midtesting = False
|
||||||
last_test.is_submited = False
|
last_test.is_submited = False
|
||||||
|
@ -718,7 +718,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
wp.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
wp.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||||
if needTest: #子工序若需要检验
|
if needTest: #子工序若需要检验
|
||||||
wp.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
wp.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
||||||
last_test = wp.last_process_test
|
last_test = wp.last_wp_test
|
||||||
if last_test and reuseForm:
|
if last_test and reuseForm:
|
||||||
last_test.is_midtesting = True
|
last_test.is_midtesting = True
|
||||||
last_test.is_submited = False
|
last_test.is_submited = False
|
||||||
|
@ -770,7 +770,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
wproduct.subproduction_plan = oms_w.subproduction_plan
|
wproduct.subproduction_plan = oms_w.subproduction_plan
|
||||||
if step == newstep:
|
if step == newstep:
|
||||||
wproduct.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
wproduct.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
||||||
last_test = wproduct.last_process_test
|
last_test = wproduct.last_wp_test
|
||||||
if last_test and reuseForm:
|
if last_test and reuseForm:
|
||||||
last_test.is_midtesting = False
|
last_test.is_midtesting = False
|
||||||
last_test.is_submited = False
|
last_test.is_submited = False
|
||||||
|
@ -781,7 +781,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
||||||
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
wproduct.act_state = WProduct.WPR_ACT_STATE_DOWAIT
|
||||||
if needTest:
|
if needTest:
|
||||||
wproduct.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
wproduct.act_state = WProduct.WPR_ACT_STATE_TOTEST
|
||||||
last_test = wproduct.last_process_test
|
last_test = wproduct.last_wp_test
|
||||||
if last_test and reuseForm:
|
if last_test and reuseForm:
|
||||||
last_test.is_midtesting = True
|
last_test.is_midtesting = True
|
||||||
last_test.is_submited = False
|
last_test.is_submited = False
|
||||||
|
|
Loading…
Reference in New Issue