优化agv及新增中控日志调用
This commit is contained in:
@@ -951,6 +951,9 @@ class CNCprocessing(models.Model):
|
||||
if workpiece_delivery:
|
||||
for item in workpiece_delivery:
|
||||
item.is_cnc_program_down = True
|
||||
if item.workorder_id.state == 'waiting':
|
||||
item.workorder_id.state = 'ready'
|
||||
|
||||
# cnc_workorder.time_ids.date_end = datetime.now()
|
||||
# cnc_workorder.button_finish()
|
||||
|
||||
@@ -1184,6 +1187,8 @@ class WorkPieceDelivery(models.Model):
|
||||
num = 0
|
||||
for item in self:
|
||||
num += 1
|
||||
if production_type is None:
|
||||
production_type = item.type
|
||||
if item.type == "运送空料架":
|
||||
if num >= 2:
|
||||
raise UserError('仅选择一条路线进行配送,请重新选择')
|
||||
@@ -1201,8 +1206,6 @@ class WorkPieceDelivery(models.Model):
|
||||
is_not_route += 1
|
||||
else:
|
||||
raise UserError('请选择【任务路线】再进行配送')
|
||||
if production_type is None:
|
||||
production_type = item.type
|
||||
if production_type != item.type:
|
||||
raise UserError('请选择类型为%s的制造订单进行配送' % production_type)
|
||||
if down_status != item.status:
|
||||
@@ -1228,8 +1231,7 @@ class WorkPieceDelivery(models.Model):
|
||||
raise UserError('您所选择制造订单的【目的生产线】不一致,请重新确认')
|
||||
if is_not_route >= 1:
|
||||
raise UserError('您所选择制造订单的【任务路线】不一致,请重新确认')
|
||||
# is_free = self._check_avgsite_state()
|
||||
is_free = True
|
||||
is_free = self._check_avgsite_state()
|
||||
if is_free is True:
|
||||
if delivery_ids:
|
||||
return {
|
||||
@@ -1243,6 +1245,7 @@ class WorkPieceDelivery(models.Model):
|
||||
'default_production_ids': [(6, 0, production_ids)],
|
||||
'default_destination_production_line_id': same_production_line_id,
|
||||
'default_route_id': same_route_id,
|
||||
'default_type': production_type,
|
||||
}}
|
||||
else:
|
||||
if self.type == '运送空料架':
|
||||
|
||||
Reference in New Issue
Block a user