修复“装夹预调工单没有测量数据时点击左上角的【完成】按钮直接完成工单了”

This commit is contained in:
mgw
2024-09-13 10:37:50 +08:00
parent 1719e0394e
commit 7c01196f17

View File

@@ -1179,7 +1179,7 @@ class ResMrpWorkOrder(models.Model):
if not record.rfid_code and record.is_rework is False:
raise UserError("请扫RFID码进行绑定")
if record.is_rework is False:
if not record.material_center_point and record.X_deviation_angle > 0:
if not record.material_center_point or record.X_deviation_angle <= 0:
raise UserError("坯料中心点为空或X偏差角度小于等于0")
record.process_state = '待加工'
# record.write({'process_state': '待加工'})