From 58acdc4913127f3bead850dbedba000e49714fec Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Thu, 2 Jan 2025 16:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E7=A1=AE=E8=AE=A4=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E8=A1=A8=E9=9D=A2=E5=B7=A5=E8=89=BA=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E5=85=B3=E8=81=94=E9=87=87=E8=B4=AD=E5=8D=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_sale/models/sale_order.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 1b282c8e..621ddfc7 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -396,23 +396,6 @@ class RePurchaseOrder(models.Model): 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): - work_ids = workorder.production_id.workorder_ids.filtered( - lambda wk: wk.state not in ['done', 'rework', 'cancel']) - min_sequence_wk = min(work_ids, key=lambda wk: wk.sequence) - artificial_offline = ( - workorder.production_id.production_type == '人工线下加工' and workorder.production_id.schedule_state != '已排') - auto_production = ( - workorder.production_id.production_type == '自动化产线加工' and workorder.production_id.programming_state != '已编程') - if workorder.sequence == min_sequence_wk.sequence: - if artificial_offline or auto_production: - raise UserError('等待组件') - else: - sorted_work_ids = work_ids.sorted(key=lambda w: w.sequence) - previous_workorder = self.env['mrp.workorder'].search([('sequence', '<', workorder.sequence), - ('production_id', '=', workorder.production_id.id), - ('state', '=', 'done')], order='sequence desc', limit=1) - if not previous_workorder: - raise UserError('等待组件') workorder.state = 'ready' return result