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] =?UTF-8?q?1=E3=80=81=E5=A4=84=E7=90=86=E5=88=B6=E9=80=A0?=
=?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=BF=94=E5=B7=A5=E7=A1=AE=E8=AE=A4=E5=90=8E?=
=?UTF-8?q?=EF=BC=8C=E7=8A=B6=E6=80=81=E8=BF=98=E6=98=AF=E8=BF=94=E5=B7=A5?=
=?UTF-8?q?=E7=9A=84bug=EF=BC=9B2=E3=80=81=E9=9A=90=E8=97=8F=E5=B7=B2?=
=?UTF-8?q?=E5=8F=96=E6=B6=88=E7=8A=B6=E6=80=81=E7=9A=84=E9=87=87=E8=B4=AD?=
=?UTF-8?q?=E5=8D=95=E3=80=90=E7=A1=AE=E8=AE=A4=E8=AE=A2=E5=8D=95=E3=80=91?=
=?UTF-8?q?=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 @@