From f897955f688037e0a6ba770722c368eb63b913ad Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Tue, 22 Oct 2024 11:45:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AE=A2=E5=8D=95=E4=BA=A4=E6=9C=9F=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 6584b04f..b956e902 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -37,10 +37,10 @@ class MrpProduction(models.Model): @api.depends('procurement_group_id.mrp_production_ids.move_dest_ids.group_id.sale_id') def _compute_deadline_of_delivery(self): for production in self: - sale_order_ids = production.procurement_group_id.mrp_production_ids.move_dest_ids.group_id.sale_id.ids - if not sale_order_ids or len(sale_order_ids) < 1: + sale_order_id = production.procurement_group_id.mrp_production_ids.move_dest_ids.group_id.sale_id + if not sale_order_id: continue - sale_id = self.env['sale.order'].sudo().browse(sale_order_ids[0]) + sale_id = self.env['sale.order'].sudo().browse(sale_order_id) if sale_id: production.deadline_of_delivery = sale_id.deadline_of_delivery