修复站点状态未变,及页面筛选框优化
This commit is contained in:
@@ -32,6 +32,8 @@ class AgvSetting(models.Model):
|
|||||||
if da['DeviceId'] == item.name:
|
if da['DeviceId'] == item.name:
|
||||||
if da['AtHome'] is True:
|
if da['AtHome'] is True:
|
||||||
item.state = '占用'
|
item.state = '占用'
|
||||||
|
else:
|
||||||
|
item.state = '空闲'
|
||||||
|
|
||||||
|
|
||||||
class AgvTaskRoute(models.Model):
|
class AgvTaskRoute(models.Model):
|
||||||
|
|||||||
@@ -1081,9 +1081,7 @@ class WorkPieceDelivery(models.Model):
|
|||||||
delivery_num = fields.Char('工件配送编码')
|
delivery_num = fields.Char('工件配送编码')
|
||||||
workorder_id = fields.Many2one('mrp.workorder', string='工单', readonly=True)
|
workorder_id = fields.Many2one('mrp.workorder', string='工单', readonly=True)
|
||||||
production_id = fields.Many2one('mrp.production', string='制造订单号', readonly=True)
|
production_id = fields.Many2one('mrp.production', string='制造订单号', readonly=True)
|
||||||
production_line_id = fields.Many2one('sf.production.line', compute='_compute_production_line_id',
|
production_line_id = fields.Many2one('sf.production.line', string='目的生产线')
|
||||||
string='目的生产线', readonly=True,
|
|
||||||
store=True)
|
|
||||||
plan_start_processing_time = fields.Datetime('计划开始加工时间', readonly=True)
|
plan_start_processing_time = fields.Datetime('计划开始加工时间', readonly=True)
|
||||||
|
|
||||||
route_id = fields.Many2one('sf.agv.task.route', '任务路线')
|
route_id = fields.Many2one('sf.agv.task.route', '任务路线')
|
||||||
@@ -1235,13 +1233,7 @@ class WorkPieceDelivery(models.Model):
|
|||||||
raise UserError(ret['message'])
|
raise UserError(ret['message'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.info('config-e:%s' % e)
|
logging.info('config-e:%s' % e)
|
||||||
raise UserError("工件配送请求agv失败")
|
raise UserError("工件配送请求agv失败:%s" % e)
|
||||||
|
|
||||||
@api.onchange('production_id.production_line_id')
|
|
||||||
def _compute_production_line_id(self):
|
|
||||||
if self.production_id.production_line_id:
|
|
||||||
self.production_line_id = self.production_id.production_line_id.id
|
|
||||||
self.plan_start_processing_time = self.production_id.plan_start_processing_time
|
|
||||||
|
|
||||||
@api.depends('task_delivery_time', 'task_completion_time')
|
@api.depends('task_delivery_time', 'task_completion_time')
|
||||||
def _compute_delivery_duration(self):
|
def _compute_delivery_duration(self):
|
||||||
|
|||||||
@@ -608,9 +608,12 @@
|
|||||||
<field name="model">sf.workpiece.delivery</field>
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="工件配送">
|
<search string="工件配送">
|
||||||
<filter string="待下发" name="on_down" domain="[('status', '=', '待下发'),('type','=',['上产线'])]"/>
|
<filter string="上产线且待下发" name="on_up"
|
||||||
<filter string="上产线" name="down" domain="[('type', '=', '上产线')]"/>
|
domain="[('status', '=', '待下发'),('type','=',['上产线'])]"/>
|
||||||
<filter string="下产线" name="up" domain="[('type', '=', '下产线')]"/>
|
<filter string="下产线且待下发" name="on_down"
|
||||||
|
domain="[('status', '=', '待下发'),('type','=',['下产线'])]"/>
|
||||||
|
<filter string="上产线" name="up" domain="[('type', '=', '上产线')]"/>
|
||||||
|
<filter string="下产线" name="down" domain="[('type', '=', '下产线')]"/>
|
||||||
<field name="production_id"/>
|
<field name="production_id"/>
|
||||||
<field name="feeder_station_start_id"/>
|
<field name="feeder_station_start_id"/>
|
||||||
<field name="production_line_id"/>
|
<field name="production_line_id"/>
|
||||||
@@ -631,7 +634,7 @@
|
|||||||
<field name="name">工件配送</field>
|
<field name="name">工件配送</field>
|
||||||
<field name="res_model">sf.workpiece.delivery</field>
|
<field name="res_model">sf.workpiece.delivery</field>
|
||||||
<field name="search_view_id" ref="sf_workpiece_delivery_search"/>
|
<field name="search_view_id" ref="sf_workpiece_delivery_search"/>
|
||||||
<field name="context">{'search_default_on_down':1}</field>
|
<field name="context">{'search_default_on_up':1}</field>
|
||||||
<field name="view_mode">tree,search</field>
|
<field name="view_mode">tree,search</field>
|
||||||
<field name="domain">[('type','in',['上产线','下产线'])]</field>
|
<field name="domain">[('type','in',['上产线','下产线'])]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -84,7 +84,8 @@ class sf_production_plan(models.Model):
|
|||||||
item.sudo().production_id.production_line_id = item.production_line_id.id
|
item.sudo().production_id.production_line_id = item.production_line_id.id
|
||||||
item.sudo().production_id.workorder_ids.filtered(
|
item.sudo().production_id.workorder_ids.filtered(
|
||||||
lambda b: b.routing_type == "装夹预调").workpiece_delivery_ids.write(
|
lambda b: b.routing_type == "装夹预调").workpiece_delivery_ids.write(
|
||||||
{'production_line_id': item.production_line_id.id})
|
{'production_line_id': item.production_line_id.id,
|
||||||
|
'plan_start_processing_time': item.plan_start_processing_time})
|
||||||
# item.sudo().production_id.plan_start_processing_time = item.date_planned_start
|
# item.sudo().production_id.plan_start_processing_time = item.date_planned_start
|
||||||
|
|
||||||
# @api.onchange('state')
|
# @api.onchange('state')
|
||||||
|
|||||||
Reference in New Issue
Block a user