From 3d2c62f5dbf4d7c37d41dc0b0a7c31c54a08b7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Wed, 21 Aug 2024 20:16:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=85=8D=E9=80=81=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BB=B6=E9=85=8D=E9=80=81?= =?UTF-8?q?=E5=8D=95=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/agv_scheduling.py | 4 ++-- sf_manufacturing/models/mrp_workorder.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sf_manufacturing/models/agv_scheduling.py b/sf_manufacturing/models/agv_scheduling.py index f2ac517b..7902b469 100644 --- a/sf_manufacturing/models/agv_scheduling.py +++ b/sf_manufacturing/models/agv_scheduling.py @@ -242,13 +242,13 @@ class AgvScheduling(models.Model): elif vals['state'] == '已配送': self.env['sf.workpiece.delivery'].search([('agv_scheduling_id', '=', self.id)]).write({ 'status': '已配送', - 'feeder_station_destination_id': self.end_site_id, + 'feeder_station_destination_id': self.end_site_id.id, 'route_id': self.agv_route_id.id, 'task_completion_time': fields.Datetime.now() }) elif vals['state'] == '配送中': self.env['sf.workpiece.delivery'].search([('agv_scheduling_id', '=', self.id)]).write({ - 'feeder_station_destination_id': self.end_site_id, + 'feeder_station_destination_id': self.end_site_id.id, 'route_id': self.agv_route_id.id, 'task_delivery_time': fields.Datetime.now() }) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index bb1cfce3..40382c39 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1657,14 +1657,14 @@ class WorkPieceDelivery(models.Model): obj.feeder_station_start_id.name, obj.feeder_station_destination_id.name) return obj - @api.constrains('route_id') - def _check_route_id(self): - if self.type == '运送空料架': - if self.route_id and self.name is False: - route = self.sudo().search( - [('route_id', '=', self.route_id.id), ('id', '!=', self.id), ('name', 'ilike', '运送空料架路线')]) - if route: - raise UserError("该任务路线已存在,请重新选择") + # @api.constrains('route_id') + # def _check_route_id(self): + # if self.type == '运送空料架': + # if self.route_id and self.name is False: + # route = self.sudo().search( + # [('route_id', '=', self.route_id.id), ('id', '!=', self.id), ('name', 'ilike', '运送空料架路线')]) + # if route: + # raise UserError("该任务路线已存在,请重新选择") # @api.constrains('name') # def _check_name(self):