解除装夹起点从下产线agv调度任务关联带出

This commit is contained in:
胡尧
2024-09-06 15:34:30 +08:00
parent 096542c8ff
commit 2d5ef0aae4
3 changed files with 29 additions and 2 deletions

View File

@@ -265,3 +265,17 @@ class ResMrpWorkOrder(models.Model):
'sf_agv_scheduling_mrp_workorder_ref',
string='AGV调度',
domain=[('state', '!=', '已取消')])
def get_down_product_agv_scheduling(self):
"""
获取关联的制造订单下产线的agv任务
"""
workorder_ids = self.production_id.workorder_ids
cnc_workorder = workorder_ids.filtered(
lambda w: w.routing_type == 'CNC加工' and w.state == 'done' and w.processing_panel == self.processing_panel
)
if cnc_workorder:
agv_schedulingss = cnc_workorder.agv_scheduling_ids
return agv_schedulingss.filtered(lambda a: a.state == '已配送' and a.agv_route_type == '下产线')
else:
return None