diff --git a/sf_manufacturing/models/agv_scheduling.py b/sf_manufacturing/models/agv_scheduling.py index f550149c..084dcf49 100644 --- a/sf_manufacturing/models/agv_scheduling.py +++ b/sf_manufacturing/models/agv_scheduling.py @@ -31,7 +31,7 @@ class AgvScheduling(models.Model): ('配送中', '配送中'), ('已配送', '已配送'), ('已取消', '已取消')], string='状态', default='待下发', tracking=True) - workpiece_delivery_ids = fields.One2many('sf.workpiece.delivery', 'agv_scheduling_id', string='工件配送单') + workorder_ids = fields.One2many('mrp.workorder', string='关联工单') delivery_workpieces = fields.Char('配送工件', required=True, index=True) task_create_time = fields.Datetime('任务创建时间') task_delivery_time = fields.Datetime('任务下发时间') @@ -41,6 +41,7 @@ class AgvScheduling(models.Model): @api.depends('agv_route_type') def _compute_delivery_workpieces(self): for record in self: + record.delivery_workpieces = '、'.join(record.workorder_ids.mapped('production_id.name')) if record.agv_route_type == '运送空料架': record.delivery_workpieces_display = '/' else: