From d82cb1e64c14cc9fe662352aa2fc6ea2a2739f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Wed, 25 Dec 2024 11:31:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=8B=E5=B7=A5=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E8=A1=A8=E9=9D=A2=E5=B7=A5=E8=89=BA=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=8D=95=E7=94=B1=E4=BA=8E=E6=B2=A1=E6=9C=89=E6=BA=90=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/sale_order.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 2e99de70..aa8d36b8 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -370,11 +370,12 @@ class RePurchaseOrder(models.Model): move_id.put_move_line() for line in item.order_line: if line.product_id.categ_type == '表面工艺': - for production_name in item.origin.split(','): - production = self.env['mrp.production'].search([('name', '=', production_name)]) - for workorder in production.workorder_ids.filtered( - lambda wd: wd.routing_type == '表面工艺' and wd.state == 'waiting' and line.product_id.server_product_process_parameters_id == wd.surface_technics_parameters_id): - workorder.state = 'ready' + if item.origin: + for production_name in item.origin.split(','): + production = self.env['mrp.production'].search([('name', '=', production_name)]) + for workorder in production.workorder_ids.filtered( + lambda wd: wd.routing_type == '表面工艺' and wd.state == 'waiting' and line.product_id.server_product_process_parameters_id == wd.surface_technics_parameters_id): + workorder.state = 'ready' return result