From 1d271d916772ef833d36db6f0d2fb2fb4a677c91 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Tue, 23 Jul 2024 15:46:15 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E5=A4=8Dfeature/=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=E5=B7=A5=E5=8D=95cnc=E6=A0=A1=E9=AA=8Cbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_production.py | 5 ++++-
.../views/mrp_production_addional_change.xml | 2 +-
sf_tool_management/models/mrp_workorder.py | 18 +++++++++++++-----
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index 33795920..068431f8 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -122,7 +122,7 @@ class MrpProduction(models.Model):
is_scrap = fields.Boolean('是否报废', default=False)
@api.depends(
- 'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state',
+ 'move_raw_ids.state', 'move_raw_ids.quantity_done', 'move_finished_ids.state', 'tool_state',
'workorder_ids.state', 'product_qty', 'qty_producing', 'schedule_state')
def _compute_state(self):
for production in self:
@@ -182,6 +182,9 @@ class MrpProduction(models.Model):
for wo in
production.workorder_ids):
production.state = 'rework'
+ # 如果制造订单的功能刀具为【无效刀】则制造订单状态改为返工
+ if production.tool_state == '2':
+ production.state = 'rework'
def action_check(self):
"""
diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml
index 0e4d4391..818df620 100644
--- a/sf_manufacturing/views/mrp_production_addional_change.xml
+++ b/sf_manufacturing/views/mrp_production_addional_change.xml
@@ -101,7 +101,7 @@
-
+