1、质检单有关后置三元检测的字段和页签添加工单没有后置三元检测时隐藏的条件;2、工单添加质检单跳转按钮
This commit is contained in:
@@ -17,6 +17,7 @@ class QualityCheck(models.Model):
|
||||
('fail', '失败的')], string='状态', tracking=True, store=True,
|
||||
default='none', copy=False, compute='_compute_quality_state')
|
||||
|
||||
individuation_page_PTD = fields.Boolean('个性化记录(是否显示后置三元检测[PTD]页签)', related='workorder_id.individuation_page_PTD')
|
||||
work_state = fields.Selection(related='workorder_id.state', string='工单状态')
|
||||
processing_panel = fields.Char(related='workorder_id.processing_panel', string='加工面')
|
||||
|
||||
@@ -26,7 +27,7 @@ class QualityCheck(models.Model):
|
||||
model_file = fields.Binary(related='workorder_id.glb_file', string='加工模型')
|
||||
|
||||
detection_report = fields.Binary(related='workorder_id.detection_report', readonly=True, string='检测报告')
|
||||
test_results = fields.Selection([("合格", "合格"), ("返工", "返工"), ("报废", "报废")], string="检测结果",
|
||||
test_results = fields.Selection([("合格", "合格"), ("返工", "返工")], string="检测结果",
|
||||
default='合格')
|
||||
reason = fields.Selection(
|
||||
[("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"), ("operate computer", "操机"),
|
||||
@@ -61,7 +62,7 @@ class QualityCheck(models.Model):
|
||||
def do_pass(self):
|
||||
self.ensure_one()
|
||||
super().do_pass()
|
||||
if self.workorder_id:
|
||||
if self.workorder_id and self.individuation_page_PTD is True:
|
||||
# 1)将页签“判定结果”的检测结果值同步到【工单_后置三元检测_检测结果】
|
||||
if self.test_results in ['返工', '报废']:
|
||||
raise ValidationError('请重新选择【判定结果】-【检测结果】')
|
||||
@@ -73,7 +74,7 @@ class QualityCheck(models.Model):
|
||||
def do_fail(self):
|
||||
self.ensure_one()
|
||||
super().do_fail()
|
||||
if self.workorder_id:
|
||||
if self.workorder_id and self.individuation_page_PTD is True:
|
||||
# 1)将页签“判定结果”的检测结果值同步到【工单_后置三元检测_检测结果】
|
||||
if not self.test_results:
|
||||
raise ValidationError('请填写【判定结果】里的信息')
|
||||
|
||||
Reference in New Issue
Block a user