还原代码
This commit is contained in:
@@ -1203,21 +1203,21 @@ class ResMrpWorkOrder(models.Model):
|
||||
|
||||
if self.sequence == 1:
|
||||
# 判断工单状态是否为等待组件
|
||||
# if self.state == 'waiting':
|
||||
# raise UserError('制造订单【%s】缺少组件信息!' % self.production_id.name)
|
||||
# # 判断是否有坯料的序列号信息
|
||||
# boolean = False
|
||||
# if self.production_id.move_raw_ids:
|
||||
# if self.production_id.move_raw_ids[0].product_id.categ_type == '坯料':
|
||||
# if self.production_id.move_raw_ids[0].move_line_ids:
|
||||
# if self.production_id.move_raw_ids[0].move_line_ids:
|
||||
# if self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name:
|
||||
# boolean = True
|
||||
# else:
|
||||
# boolean = True
|
||||
# if not boolean:
|
||||
# raise UserError('制造订单【%s】缺少组件的序列号信息!' % self.production_id.name)
|
||||
# self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||
if self.state == 'waiting':
|
||||
raise UserError('制造订单【%s】缺少组件信息!' % self.production_id.name)
|
||||
# 判断是否有坯料的序列号信息
|
||||
boolean = False
|
||||
if self.production_id.move_raw_ids:
|
||||
if self.production_id.move_raw_ids[0].product_id.categ_type == '坯料':
|
||||
if self.production_id.move_raw_ids[0].move_line_ids:
|
||||
if self.production_id.move_raw_ids[0].move_line_ids:
|
||||
if self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name:
|
||||
boolean = True
|
||||
else:
|
||||
boolean = True
|
||||
if not boolean:
|
||||
raise UserError('制造订单【%s】缺少组件的序列号信息!' % self.production_id.name)
|
||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||
# cnc校验
|
||||
if self.production_id.production_type == '自动化产线加工':
|
||||
cnc_workorder = self.search(
|
||||
@@ -1318,11 +1318,11 @@ class ResMrpWorkOrder(models.Model):
|
||||
def button_finish(self):
|
||||
for record in self:
|
||||
if record.routing_type == '装夹预调':
|
||||
# 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:
|
||||
# raise UserError("坯料中心点为空,请检查")
|
||||
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:
|
||||
raise UserError("坯料中心点为空,请检查")
|
||||
# if record.X_deviation_angle <= 0:
|
||||
# raise UserError("X偏差角度小于等于0,请检查!本次计算的X偏差角度为:%s" % record.X_deviation_angle)
|
||||
record.process_state = '待加工'
|
||||
|
||||
Reference in New Issue
Block a user