还原代码

This commit is contained in:
jinling.yang
2024-11-18 11:40:24 +08:00
parent e8c006d495
commit a2855f1f08
4 changed files with 51 additions and 61 deletions

View File

@@ -1005,14 +1005,6 @@ class ResMrpWorkOrder(models.Model):
def _compute_state(self):
# super()._compute_state()
for workorder in self:
logging.info(workorder.name)
logging.info(workorder.state)
logging.info(workorder.sequence)
logging.info(workorder.id)
# logging.info(workorder.blocked_by_workorder_ids)
# logging.info(workorder.blocked_by_workorder_ids.name)
# logging.info(workorder.blocked_by_workorder_ids.sequence)
logging.info('----------------------')
if workorder.sequence != 1:
previous_workorder = self.env['mrp.workorder'].search(
[('production_id', '=', workorder.production_id.id),
@@ -1308,9 +1300,9 @@ class ResMrpWorkOrder(models.Model):
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 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 = '待加工'
@@ -1344,8 +1336,8 @@ class ResMrpWorkOrder(models.Model):
if record.routing_type == '表面工艺':
if record.picking_ids:
picks = record.picking_ids.filtered(lambda p: p.state not in ('done'))
# if picks:
# raise UserError('请先完成该工单的工艺外协再进行操作')
if picks:
raise UserError('请先完成该工单的工艺外协再进行操作')
tem_date_planned_finished = record.date_planned_finished
tem_date_finished = record.date_finished
logging.info('routing_type:%s' % record.routing_type)