+
申请重新编程
+ attrs='{"readonly": ["|",("is_reprogramming_readonly","=",False),("tool_state", "=", "2")]}'/>
From b731ffba331fc57959578190d78fca7096f1cd66 Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Fri, 26 Jul 2024 14:51:23 +0800
Subject: [PATCH 09/12] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=B7=A5?=
=?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_production.py | 5 +++++
sf_tool_management/models/mrp_workorder.py | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index 27baa7be..0bbda373 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -50,6 +50,7 @@ class MrpProduction(models.Model):
def _compute_tool_state(self):
for item in self:
if item.workorder_ids:
+ tool_state = item.tool_state
workorder_ids = item.workorder_ids.filtered(lambda a: a.state not in ('rework', '返工'))
if workorder_ids.filtered(lambda a: a.tool_state == '2'):
item.tool_state = '2'
@@ -57,6 +58,10 @@ class MrpProduction(models.Model):
item.tool_state = '1'
else:
item.tool_state = '0'
+ if tool_state == '2' and item.tool_state != '2':
+ item.detection_result_ids.filtered(
+ lambda a: a.detailed_reason == '无效功能刀具' and a.handle_result == '待处理').write(
+ {'handle_result': '已处理'})
# state = fields.Selection(selection_add=[
# ('pending_scheduling', '待排程'),
diff --git a/sf_tool_management/models/mrp_workorder.py b/sf_tool_management/models/mrp_workorder.py
index 352162b7..f3fc3484 100644
--- a/sf_tool_management/models/mrp_workorder.py
+++ b/sf_tool_management/models/mrp_workorder.py
@@ -105,6 +105,12 @@ class CNCprocessing(models.Model):
'test_results': '返工',
'handle_result': '待处理'
})
+ if not production_id.is_rework:
+ production_id.write({
+ 'is_rework': True
+ })
+ production_id.workorder_ids.filtered(
+ lambda a: a.processing_panel == key and not a.is_rework).write({'is_rework': True})
# 对缺刀信息进行处理
for key in data2:
if data2.get(key):
From 3e61e31314b303953b277599ed89a8ead0ddfd5c Mon Sep 17 00:00:00 2001
From: hy <1298386937@qq.com>
Date: Fri, 26 Jul 2024 15:44:52 +0800
Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=80=E5=85=B7?=
=?UTF-8?q?=E6=8B=86=E8=A7=A3=E6=97=B6=E9=80=89=E6=8B=A9=E7=9B=AE=E6=A0=87?=
=?UTF-8?q?=E8=B4=A7=E4=BD=8D=E4=BC=9A=E5=87=BA=E7=8E=B0=E9=87=8D=E5=8F=A0?=
=?UTF-8?q?=E7=9A=84=E7=8E=B0=E8=B1=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jikimo_frontend/static/src/scss/custom_style.scss | 6 ------
1 file changed, 6 deletions(-)
diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss
index cbd1bb4d..d7e6414c 100644
--- a/jikimo_frontend/static/src/scss/custom_style.scss
+++ b/jikimo_frontend/static/src/scss/custom_style.scss
@@ -532,9 +532,3 @@ div:has(.o_required_modifier) > label::before {
position: unset;
}
-// 修改表格下拉框会被表格下面数据框覆盖的bug
-.tab-pane .o_field_widget {
- position: relative;
- z-index: 1;
-}
-
From 66caeee1cdf224fbcdcb8dba214b9f46ad41113e Mon Sep 17 00:00:00 2001
From: yuxianghui <3437689193@qq.com>
Date: Fri, 26 Jul 2024 16:25:16 +0800
Subject: [PATCH 11/12] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=B7=A5?=
=?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_workorder.py | 20 +++++++++++++-------
sf_tool_management/models/mrp_workorder.py | 12 ++++++------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py
index 827f77df..ded46f93 100644
--- a/sf_manufacturing/models/mrp_workorder.py
+++ b/sf_manufacturing/models/mrp_workorder.py
@@ -806,8 +806,6 @@ class ResMrpWorkOrder(models.Model):
if workorder.production_id.is_rework is True:
if re_work or cnc_workorder:
workorder.state = 'waiting'
- if workorder.production_id.tool_state in ['1', '2'] and workorder.state != 'pending':
- workorder.state = 'waiting'
elif workorder.routing_type == 'CNC加工' and workorder.state not in ['done', 'rework', 'cancel']:
pre_workorder = self.env['mrp.workorder'].search(
@@ -850,11 +848,19 @@ class ResMrpWorkOrder(models.Model):
# else:
# if workorder.state not in ['cancel', 'rework']:
# workorder.state = 'rework'
- if workorder.production_id.state == 'pending_cam':
- if workorder.production_id.tool_state in ['1', '2']:
- work_ids = workorder.production_id.workorder_ids.filtered(
- lambda a: a.routing_type == '装夹预调' and a.state in ['ready', 'waiting'])
- work_ids.state = 'waiting'
+ # 当工单对应制造订单的功能刀具状态为 【无效刀】时,先对的第一个装夹预调工单状态设置为 【等待组件】
+ if workorder.production_id.tool_state in ['1', '2']:
+ if workorder.routing_type == '装夹预调':
+ if workorder.state in ['ready']:
+ workorder.state = 'waiting'
+ continue
+ elif workorder.state == 'pending' and self.search(
+ [('production_id', '=', workorder.production_id.id),
+ ('sequence', '=', workorder.sequence - 1),
+ ('state', 'in', ['done', 'rework'])]):
+ workorder.state = 'waiting'
+ continue
+
logging.info('工序:%s' % workorder.sequence)
logging.info('工单最终状态:%s' % workorder.state)
diff --git a/sf_tool_management/models/mrp_workorder.py b/sf_tool_management/models/mrp_workorder.py
index f3fc3484..eb8db183 100644
--- a/sf_tool_management/models/mrp_workorder.py
+++ b/sf_tool_management/models/mrp_workorder.py
@@ -105,12 +105,12 @@ class CNCprocessing(models.Model):
'test_results': '返工',
'handle_result': '待处理'
})
- if not production_id.is_rework:
- production_id.write({
- 'is_rework': True
- })
- production_id.workorder_ids.filtered(
- lambda a: a.processing_panel == key and not a.is_rework).write({'is_rework': True})
+ # if not production_id.is_rework:
+ # production_id.write({
+ # 'is_rework': True
+ # })
+ # production_id.workorder_ids.filtered(
+ # lambda a: a.processing_panel == key and not a.is_rework).write({'is_rework': True})
# 对缺刀信息进行处理
for key in data2:
if data2.get(key):
From 22a1ae11a6b6c882e12f9fd1990dfdd02d212690 Mon Sep 17 00:00:00 2001
From: "jinling.yang"
Date: Fri, 26 Jul 2024 16:52:48 +0800
Subject: [PATCH 12/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=B7=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_manufacturing/models/mrp_production.py | 4 ++++
sf_manufacturing/wizard/rework_wizard.py | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index 0bbda373..6eff353d 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -902,6 +902,10 @@ class MrpProduction(models.Model):
if pre_workorder:
pre_workorder.write(
{'processing_drawing': base64.b64encode(open(panel_file_path, 'rb').read())})
+ # if production.state == 'rework' and production.programming_state == '已编程未下发':
+ # production.write(
+ # {'state': 'progress', 'programming_state': '已编程', 'is_rework': False})
+ # logging.info('返工含有已编程未下发的程序更新完成:%s' % production.name)
logging.info('更新程序完成:%s' % production.name)
else:
diff --git a/sf_manufacturing/wizard/rework_wizard.py b/sf_manufacturing/wizard/rework_wizard.py
index bf1224fb..a52c5093 100644
--- a/sf_manufacturing/wizard/rework_wizard.py
+++ b/sf_manufacturing/wizard/rework_wizard.py
@@ -165,6 +165,13 @@ class ReworkWizard(models.TransientModel):
{'programming_state': '编程中', 'work_state': '编程中'})
if self.production_id.state == 'progress':
self.production_id.write({'programming_state': '已编程', 'work_state': '已编程'})
+ if self.reprogramming_num >= 1 and self.programming_state == '已编程':
+ productions_not_delivered = self.env['mrp.production'].search(
+ [('programming_no', '=', self.production_id.programming_no),
+ ('programming_state', '=', '已编程未下发')])
+ if productions_not_delivered:
+ productions_not_delivered.write(
+ {'programming_state': '已编程', 'work_state': '已编程', 'is_rework': False})
@api.onchange('production_id')
def onchange_processing_panel_id(self):