From 41b287d5590504f2487540bc828ddeb91a786f05 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Mon, 21 Oct 2024 16:06:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A2=E5=8D=95=E4=BA=A4=E6=9C=9F=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=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 | 2 -- 1 file changed, 2 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 361d6b98..3269164c 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -37,8 +37,6 @@ 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: - production.sale_order_count = len( - production.procurement_group_id.mrp_production_ids.move_dest_ids.group_id.sale_id) sale_order_ids = production.procurement_group_id.mrp_production_ids.move_dest_ids.group_id.sale_id.ids if len(sale_order_ids) < 1: continue From 736a18518c7764aeb9fda84d1351aeb4e473bf78 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Mon, 21 Oct 2024 16:07:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A2=E5=8D=95=E4=BA=A4=E6=9C=9F=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 3269164c..6584b04f 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -38,7 +38,7 @@ class MrpProduction(models.Model): 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 len(sale_order_ids) < 1: + if not sale_order_ids or len(sale_order_ids) < 1: continue sale_id = self.env['sale.order'].sudo().browse(sale_order_ids[0]) if sale_id: