优化agv及新增中控日志调用
This commit is contained in:
@@ -49,3 +49,13 @@ class AgvTaskRoute(models.Model):
|
||||
end_site_id = fields.Many2one('sf.agv.site', '终点接驳站位置编号')
|
||||
destination_production_line_id = fields.Many2one('sf.production.line', '目的生产线')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class Center_controlInterfaceLog(models.Model):
|
||||
_name = 'center_control.interface.log'
|
||||
_description = '中控接口调用日志'
|
||||
|
||||
name = fields.Char('接口名称')
|
||||
content = fields.Char('接口内容')
|
||||
interface_call_date = fields.Datetime("调用时间", default=fields.Datetime.now, readonly=True)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@@ -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 == '运送空料架':
|
||||
|
||||
@@ -7,8 +7,8 @@ import os
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user