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 01/11] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=89=8B=E5=B7=A5?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=A1=A8=E9=9D=A2=E5=B7=A5=E8=89=BA=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=8D=95=E7=94=B1=E4=BA=8E=E6=B2=A1=E6=9C=89=E6=BA=90?= =?UTF-8?q?=E5=8D=95=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 From 7f17ff8b783b2812e52cc44c17f52fd77bec94b7 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 25 Dec 2024 13:02:49 +0800 Subject: [PATCH 02/11] =?UTF-8?q?1=E3=80=81=E5=A4=84=E7=90=86=E5=88=B6?= =?UTF-8?q?=E9=80=A0=E8=AE=A2=E5=8D=95=E8=BF=94=E5=B7=A5=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E7=8A=B6=E6=80=81=E8=BF=98=E6=98=AF=E8=BF=94?= =?UTF-8?q?=E5=B7=A5=E7=9A=84bug=EF=BC=9B2=E3=80=81=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=B7=B2=E5=8F=96=E6=B6=88=E7=8A=B6=E6=80=81=E7=9A=84=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=8D=95=E3=80=90=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E3=80=91=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 13 ++++--------- sf_sale/views/purchase_order_view.xml | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index a7e9398c..211054a7 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -363,15 +363,10 @@ class MrpProduction(models.Model): # if production.state == 'pending_cam': # if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')): # production.state = 'done' - if any( - ( - wo.test_results == '返工' and wo.state == 'done' and production.programming_state in [ - '已编程']) or ( - wo.state == 'rework' and production.programming_state == '编程中') or ( - wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', - '已编程']) - for wo in - production.workorder_ids): + if any((wo.test_results == '返工' and wo.state == 'done' and production.programming_state in ['已编程']) + or (wo.state == 'rework' and production.programming_state == '编程中') + or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程']) + for wo in production.workorder_ids) and production.state not in ['progress']: production.state = 'rework' if any(wo.test_results == '报废' and wo.state == 'done' for wo in production.workorder_ids): production.state = 'scrap' diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml index be35d8a2..615d1b03 100644 --- a/sf_sale/views/purchase_order_view.xml +++ b/sf_sale/views/purchase_order_view.xml @@ -42,7 +42,7 @@