From 939f3d58f434e377ecac1360b4ab8fdc3e29ea84 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Wed, 16 Oct 2024 11:41:15 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=96=B0=E5=A2=9E2D?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=9B=BE=E7=BA=B8,=E8=B4=A8=E6=A3=80?= =?UTF-8?q?=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_dlm_management/views/product_template_management_view.xml | 2 ++ sf_manufacturing/models/product_template.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index f53c5e2b..69c1a8b0 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -16,6 +16,8 @@ + + Date: Wed, 16 Oct 2024 11:49:05 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E8=B4=A8=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 +- sf_quality/views/view.xml | 62 ++++++++++----------- sf_sale/models/quick_easy_order.py | 4 +- sf_sale/models/quick_easy_order_old.py | 4 +- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 7f4dc2b8..b9f4a4c8 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError from odoo.modules import get_resource_path -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_quality/views/view.xml b/sf_quality/views/view.xml index 1ed999d6..38d80094 100644 --- a/sf_quality/views/view.xml +++ b/sf_quality/views/view.xml @@ -34,36 +34,36 @@ - - quality.point.form.inherit.sf - quality.point - - - - - - - custom_required - 1 - - - custom_required - 1 - - - + + + + + + + + + + + + + + + + + + - - sf.quality.point.form.inherit.sf - quality.point - - - - custom_required - - - custom_required - - - + + + + + + + + + + + + + diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 081807a4..cb1886a1 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 4756a2c5..9bd61132 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path From f4f7087465ce3f2299f94974b392a9a853cd2126 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 16 Oct 2024 14:06:18 +0800 Subject: [PATCH 03/23] =?UTF-8?q?=E6=B7=BB=E5=8A=A02D=E5=9B=BE=E7=BA=B8?= =?UTF-8?q?=E5=92=8C=E8=B4=A8=E9=87=8F=E6=A0=87=E5=87=862=E4=B8=AA?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_quality/models/quality_cnc_test.py | 2 ++ sf_quality/views/quality_cnc_test_view.xml | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sf_quality/models/quality_cnc_test.py b/sf_quality/models/quality_cnc_test.py index f3fe5dbd..8bcbf819 100644 --- a/sf_quality/models/quality_cnc_test.py +++ b/sf_quality/models/quality_cnc_test.py @@ -30,6 +30,8 @@ class SfQualityCncTest(models.Model): [("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"), ("operate computer", "操机"), ("technology", "工艺"), ("customer redrawing", "客户改图")], string="原因") detailed_reason = fields.Text('详细原因') + machining_drawings = fields.Binary(related='workorder_id.machining_drawings', string='2D加工图纸', readonly=True) + quality_standard = fields.Binary(related='workorder_id.quality_standard', string='质检标准', readonly=True) def submit_pass(self): self.write({'result': 'pass', 'test_results': self.test_results, 'state': 'done'}) diff --git a/sf_quality/views/quality_cnc_test_view.xml b/sf_quality/views/quality_cnc_test_view.xml index a9bceffe..8f6f2c71 100644 --- a/sf_quality/views/quality_cnc_test_view.xml +++ b/sf_quality/views/quality_cnc_test_view.xml @@ -89,7 +89,6 @@ - @@ -104,10 +103,10 @@ - + - + From fab1d77d64524445cf0100d5b017c19c1114c7d9 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 16 Oct 2024 14:07:35 +0800 Subject: [PATCH 04/23] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 ++-- sf_sale/models/quick_easy_order.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 2a1bfdd2..8e81d076 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError from odoo.modules import get_resource_path -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index cb1886a1..081807a4 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 9bd61132..4756a2c5 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path From 4adc3b700aab850076da6a93a92abfa0909dc6c4 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 16 Oct 2024 15:32:47 +0800 Subject: [PATCH 05/23] =?UTF-8?q?Merge=20branch=20'develop'=20of=20https:/?= =?UTF-8?q?/e.coding.net/jikimo-hn/jikimo=5Fsfs/jikimo=5Fsf=20into=20featu?= =?UTF-8?q?re/=E5=B7=A5=E5=8D=95=E5=AE=9A=E6=97=B6=E5=99=A8=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=97=B6=E5=8C=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_message/data/bussiness_node.xml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sf_message/data/bussiness_node.xml b/sf_message/data/bussiness_node.xml index d9ac9ae1..240f7b9c 100644 --- a/sf_message/data/bussiness_node.xml +++ b/sf_message/data/bussiness_node.xml @@ -58,17 +58,8 @@ 订单发货提醒 stock.picking - - - - - - - - - - + 装夹预调工单逾期预警 mrp.workorder @@ -77,12 +68,12 @@ mrp.workorder - + CNC加工工单逾期预警 mrp.workorder - CNC工单已逾期 + CNC加工工单已逾期 mrp.workorder @@ -96,7 +87,7 @@ mrp.workorder - + 表面工艺工单逾期预警 mrp.workorder From 9cd8d9d823d045fa20a60499509148bd533bc9c8 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 16 Oct 2024 17:59:34 +0800 Subject: [PATCH 06/23] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 ++-- sf_quality/models/quality_cnc_test.py | 6 +++--- sf_quality/views/quality_cnc_test_view.xml | 12 +++++++----- sf_sale/models/quick_easy_order.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 8e81d076..2a1bfdd2 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError from odoo.modules import get_resource_path -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_quality/models/quality_cnc_test.py b/sf_quality/models/quality_cnc_test.py index 8bcbf819..9d8e7ce6 100644 --- a/sf_quality/models/quality_cnc_test.py +++ b/sf_quality/models/quality_cnc_test.py @@ -30,11 +30,11 @@ class SfQualityCncTest(models.Model): [("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"), ("operate computer", "操机"), ("technology", "工艺"), ("customer redrawing", "客户改图")], string="原因") detailed_reason = fields.Text('详细原因') - machining_drawings = fields.Binary(related='workorder_id.machining_drawings', string='2D加工图纸', readonly=True) - quality_standard = fields.Binary(related='workorder_id.quality_standard', string='质检标准', readonly=True) + # machining_drawings = fields.Binary(related='workorder_id.machining_drawings', string='2D加工图纸', readonly=True) + # quality_standard = fields.Binary(related='workorder_id.quality_standard', string='质检标准', readonly=True) def submit_pass(self): - self.write({'result': 'pass', 'test_results': self.test_results, 'state': 'done'}) + self.write({'result': 'pass', 'test_results': '合格', 'state': 'done'}) self.workorder_id.write({'test_results': self.test_results}) self.workorder_id.button_finish() diff --git a/sf_quality/views/quality_cnc_test_view.xml b/sf_quality/views/quality_cnc_test_view.xml index 8f6f2c71..b0aad55d 100644 --- a/sf_quality/views/quality_cnc_test_view.xml +++ b/sf_quality/views/quality_cnc_test_view.xml @@ -5,7 +5,7 @@ 加工质检单编码规则 quality.cnc.test QCT - 4 + 5 @@ -98,15 +98,17 @@ - - + + - + - + diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 081807a4..cb1886a1 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 4756a2c5..9bd61132 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path From 0e8bda3369313bd609a5ba4881cdc55413bf97e9 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 09:58:24 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E8=B4=A8=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 ++-- sf_quality/models/quality_cnc_test.py | 22 +++++++++++++++------ sf_quality/views/quality_cnc_test_view.xml | 16 +++++++++------ sf_sale/models/quick_easy_order.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 2a1bfdd2..8e81d076 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError from odoo.modules import get_resource_path -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_quality/models/quality_cnc_test.py b/sf_quality/models/quality_cnc_test.py index 9d8e7ce6..0905eb05 100644 --- a/sf_quality/models/quality_cnc_test.py +++ b/sf_quality/models/quality_cnc_test.py @@ -30,22 +30,32 @@ class SfQualityCncTest(models.Model): [("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"), ("operate computer", "操机"), ("technology", "工艺"), ("customer redrawing", "客户改图")], string="原因") detailed_reason = fields.Text('详细原因') + # machining_drawings = fields.Binary(related='workorder_id.machining_drawings', string='2D加工图纸', readonly=True) # quality_standard = fields.Binary(related='workorder_id.quality_standard', string='质检标准', readonly=True) def submit_pass(self): + if self.test_results in ['返工', '报废']: + raise UserError(_('请重新选择【判定结果】-【检测结果】')) self.write({'result': 'pass', 'test_results': '合格', 'state': 'done'}) self.workorder_id.write({'test_results': self.test_results}) self.workorder_id.button_finish() def submit_fail(self): - if not self.reason and not self.detailed_reason and not self.test_results: + if not self.test_results: raise UserError(_('请填写【判定结果】里的信息')) - else: - self.write({'result': 'fail', 'test_results': self.test_results, 'state': 'done'}) - self.workorder_id.write( - {'test_results': self.test_results, 'reason': self.reason, 'detailed_reason': self.detailed_reason}) - self.workorder_id.button_finish() + if self.test_results == '合格': + raise UserError(_('请重新选择【判定结果】-【检测结果】')) + self.write({'result': 'fail', 'test_results': self.test_results, 'state': 'done'}) + self.workorder_id.write( + {'test_results': self.test_results, 'reason': self.reason, 'detailed_reason': self.detailed_reason}) + self.workorder_id.button_finish() + + @api.onchange('test_results') + def _onchange_test_results(self): + if self.test_results == '合格': + self.reason = False + self.detailed_reason = False class SfQualityWorkOrder(models.Model): diff --git a/sf_quality/views/quality_cnc_test_view.xml b/sf_quality/views/quality_cnc_test_view.xml index b0aad55d..967ef585 100644 --- a/sf_quality/views/quality_cnc_test_view.xml +++ b/sf_quality/views/quality_cnc_test_view.xml @@ -20,8 +20,12 @@ - - + + @@ -99,9 +103,9 @@ + attrs="{'readonly': [('state','=', 'done')],'required': [('test_results','in', ['返工','报废'])],'invisible': [('test_results','in', ['合格',False])]}"/> + attrs="{'readonly': [('state','=', 'done')],'required': [('reason','!=', False)],'invisible': [('test_results','in', ['合格',False])]}"/> @@ -110,7 +114,7 @@ - + @@ -172,7 +176,7 @@ 驾驶舱 ir.actions.act_window quality.cnc.test - kanban,form + kanban,tree,form [] diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index cb1886a1..081807a4 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 9bd61132..4756a2c5 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path From bf39ed10b4ab380469b21f2529c176328cc385b3 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 10:03:45 +0800 Subject: [PATCH 08/23] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 8 ++++---- sf_sale/views/quick_easy_order_view.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 8e81d076..6c6b1bf8 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -774,8 +774,8 @@ class ResProductMo(models.Model): # bfm下单 manual_quotation = fields.Boolean('人工编程', default=False, readonly=True) part_number = fields.Char(string='零件图号', readonly=True) - machining_drawings = fields.Binary('2D加工图纸', readonly=True) - quality_standard = fields.Binary('质检标准', readonly=True) + # machining_drawings = fields.Binary('2D加工图纸', readonly=True) + # quality_standard = fields.Binary('质检标准', readonly=True) @api.constrains('tool_length') def _check_tool_length_size(self): @@ -875,8 +875,8 @@ class ResProductMo(models.Model): 'manual_quotation': item['manual_quotation'] or False, 'part_number': item.get('part_number') or '', 'active': True, - 'machining_drawings': '' if not item['machining_drawings'] else base64.b64decode(item['machining_drawings']), - 'quality_standard': '' if not item['quality_standard'] else base64.b64decode(item['quality_standard']), + # 'machining_drawings': '' if not item['machining_drawings'] else base64.b64decode(item['machining_drawings']), + # 'quality_standard': '' if not item['quality_standard'] else base64.b64decode(item['quality_standard']), } tax_id = self.env['account.tax'].sudo().search( [('type_tax_use', '=', 'sale'), ('amount', '=', item.get('tax')), ('price_include', '=', 'True')]) diff --git a/sf_sale/views/quick_easy_order_view.xml b/sf_sale/views/quick_easy_order_view.xml index aebb4e97..9111403d 100644 --- a/sf_sale/views/quick_easy_order_view.xml +++ b/sf_sale/views/quick_easy_order_view.xml @@ -80,8 +80,8 @@ - - + + From 919450aafb70b654b35932afc85746f5d3e29f47 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 17 Oct 2024 10:13:54 +0800 Subject: [PATCH 09/23] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=B6=E9=80=A0?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=A0=E6=95=88=E5=88=80=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=BC=96=E7=A8=8B=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/mrp_workorder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sf_tool_management/models/mrp_workorder.py b/sf_tool_management/models/mrp_workorder.py index 9326b511..71a6282e 100644 --- a/sf_tool_management/models/mrp_workorder.py +++ b/sf_tool_management/models/mrp_workorder.py @@ -194,6 +194,7 @@ class MrpProduction(models.Model): # 自动调用重新获取编程的方法 logging.info('cnc用刀校验到无效刀自动调用重新编程方法:update_programming_state()') self[0].update_programming_state() + self[0].write({'is_rework': False}) # 修改制造订单 编程状态变为“编程中” 制造订单状态为‘返工’ self.write({'programming_state': '编程中', 'work_state': '编程中', 'state': 'rework'}) if missing_tool_1: From 94b1551de28235d67d03aa025fa35212098a5ecc Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 11:01:42 +0800 Subject: [PATCH 10/23] =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E8=B4=A8=E6=A3=80?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/security/ir.model.access.csv | 4 +++- sf_quality/views/quality_cnc_test_view.xml | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index fd3b0d21..d9b0fcf7 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -106,7 +106,9 @@ access_mrp_workcenter_capacity_manager_group_sf_mrp_user,mrp.workcenter.capacity access_mrp_production_group_plan_dispatch,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,1,0,0 -access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,1,0 +access_mrp_workorder_group_quality,mrp_workorder,model_mrp_workorder,sf_base.group_quality,1,1,0,0 +access_mrp_workorder_group_quality_director,mrp_workorder,model_mrp_workorder,sf_base.group_quality_director,1,1,0,0 +access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,0,0 access_sf_production_line_group_plan_dispatch,sf.production.line,model_sf_production_line,sf_base.group_plan_dispatch,1,0,0,0 access_sf_production_line_group_plan_director,sf.production.line,model_sf_production_line,sf_base.group_plan_director,1,1,1,0 access_sf_production_line,sf.production.line,model_sf_production_line,sf_maintenance.sf_group_equipment_user,1,1,1,0 diff --git a/sf_quality/views/quality_cnc_test_view.xml b/sf_quality/views/quality_cnc_test_view.xml index a9bceffe..f2594dd5 100644 --- a/sf_quality/views/quality_cnc_test_view.xml +++ b/sf_quality/views/quality_cnc_test_view.xml @@ -22,8 +22,6 @@ - - From 4e8eccfd0b9347e0ebb0e83215fceb3bc1f0091c Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 11:33:20 +0800 Subject: [PATCH 11/23] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_dlm_management/views/product_template_management_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 69c1a8b0..8f58b1ad 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -16,8 +16,8 @@ - - + + Date: Thu, 17 Oct 2024 11:58:54 +0800 Subject: [PATCH 12/23] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E8=B4=A8=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 ++-- sf_manufacturing/security/ir.model.access.csv | 7 ++++++- sf_message/models/sf_message_maintenance_logs.py | 12 ++++++------ sf_sale/models/quick_easy_order.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 6c6b1bf8..152ae0c3 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError from odoo.modules import get_resource_path -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index d9b0fcf7..b929ca47 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -104,8 +104,13 @@ access_mrp_production_split_group_sf_mrp_user,access.mrp.production.split,mrp.mo access_mrp_production_split_line_group_sf_mrp_user,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0 access_mrp_workcenter_capacity_manager_group_sf_mrp_user,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0 - +access_mrp_workcenter_productivity_loss_group_quality,mrp_workcenter_productivity_loss_group_quality,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_quality,1,0,0,0 +access_mrp_workcenter_productivity_loss_group_quality_director,mrp_workcenter_productivity_loss_group_quality_director,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_quality_director,1,0,0,0 +access_mrp_workcenter_productivity_group_quality,mrp_workcenter_productivity_group_quality,mrp.model_mrp_workcenter_productivity,sf_base.group_quality,1,1,1,0 +access_mrp_workcenter_productivity_group_quality_director,mrp_workcenter_productivity_group_quality_director,mrp.model_mrp_workcenter_productivity,sf_base.group_quality_director,1,1,1,0 access_mrp_production_group_plan_dispatch,mrp_production,model_mrp_production,sf_base.group_plan_dispatch,1,1,0,0 +access_mrp_production_group_quality,mrp_production,model_mrp_production,sf_base.group_quality,1,1,0,0 +access_mrp_production_group_quality_director,mrp_production,model_mrp_production,sf_base.group_quality_director,1,1,0,0 access_mrp_workorder_group_quality,mrp_workorder,model_mrp_workorder,sf_base.group_quality,1,1,0,0 access_mrp_workorder_group_quality_director,mrp_workorder,model_mrp_workorder,sf_base.group_quality_director,1,1,0,0 access_mrp_workorder,mrp_workorder,model_mrp_workorder,sf_base.group_plan_dispatch,1,1,0,0 diff --git a/sf_message/models/sf_message_maintenance_logs.py b/sf_message/models/sf_message_maintenance_logs.py index 288043ff..115d073b 100644 --- a/sf_message/models/sf_message_maintenance_logs.py +++ b/sf_message/models/sf_message_maintenance_logs.py @@ -4,12 +4,12 @@ class SFMessageMaintenanceLogs(models.Model): _name = 'sf.maintenance.logs' _inherit = ['sf.maintenance.logs', 'jikimo.message.dispatch'] - @api._model_create_multi - def create(self, vals_list): - res = super(SFMessageMaintenanceLogs, self).create(vals_list) - for rec in res: - rec.add_queue() - return res + # @api._model_create_multi + # def create(self, vals_list): + # res = super(SFMessageMaintenanceLogs, self).create(vals_list) + # for rec in res: + # rec.add_queue() + # return res def _get_message(self, message_queue_ids): contents = super(SFMessageMaintenanceLogs, self)._get_message(message_queue_ids) diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 081807a4..cb1886a1 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 4756a2c5..9bd61132 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -from OCC.Extend.DataExchange import read_step_file -from OCC.Extend.DataExchange import write_stl_file +# from OCC.Extend.DataExchange import read_step_file +# from OCC.Extend.DataExchange import write_stl_file from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path From 9ad582612ba4f8ba2b4c6a4d4fb9a32eff9c781e Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 13:43:43 +0800 Subject: [PATCH 13/23] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 4 ++-- sf_message/models/sf_message_maintenance_logs.py | 12 ++++++------ sf_sale/models/quick_easy_order.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 152ae0c3..6c6b1bf8 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError from odoo.modules import get_resource_path -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_message/models/sf_message_maintenance_logs.py b/sf_message/models/sf_message_maintenance_logs.py index 115d073b..288043ff 100644 --- a/sf_message/models/sf_message_maintenance_logs.py +++ b/sf_message/models/sf_message_maintenance_logs.py @@ -4,12 +4,12 @@ class SFMessageMaintenanceLogs(models.Model): _name = 'sf.maintenance.logs' _inherit = ['sf.maintenance.logs', 'jikimo.message.dispatch'] - # @api._model_create_multi - # def create(self, vals_list): - # res = super(SFMessageMaintenanceLogs, self).create(vals_list) - # for rec in res: - # rec.add_queue() - # return res + @api._model_create_multi + def create(self, vals_list): + res = super(SFMessageMaintenanceLogs, self).create(vals_list) + for rec in res: + rec.add_queue() + return res def _get_message(self, message_queue_ids): contents = super(SFMessageMaintenanceLogs, self)._get_message(message_queue_ids) diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index cb1886a1..081807a4 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -8,8 +8,8 @@ from datetime import datetime import requests from odoo import http from odoo.http import request -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file from odoo import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError diff --git a/sf_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index 9bd61132..4756a2c5 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path From 7bc7d2059cc32c47bcb7d7fbbbeaf6e3e60ff65b Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 14:06:16 +0800 Subject: [PATCH 14/23] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_quality/views/view.xml | 62 +++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/sf_quality/views/view.xml b/sf_quality/views/view.xml index 38d80094..e0b2064b 100644 --- a/sf_quality/views/view.xml +++ b/sf_quality/views/view.xml @@ -34,36 +34,36 @@ - - - - - - - - - - - - - - - - - - + + quality.point.form.inherit.sf + quality.point + + + + + + + custom_required + 1 + + + custom_required + 1 + + + - - - - - - - - - - - - - + + sf.quality.point.form.inherit.sf + quality.point + + + + custom_required + + + custom_required + + + From 1245323b9db4ac39ffaaf805365225fa3c74a064 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 17 Oct 2024 14:22:09 +0800 Subject: [PATCH 15/23] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E8=8E=B7=E5=8F=96=E7=BC=96=E7=A8=8B=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E7=BC=96?= =?UTF-8?q?=E7=A8=8B=E5=AE=8C=E6=88=90=E4=B9=8B=E5=90=8E=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E7=94=A8=E5=88=80=E6=A0=A1=E9=AA=8C=EF=BC=9B2=E3=80=81?= =?UTF-8?q?=E5=A4=84=E7=90=86=20=20=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98-?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E8=AF=A6=E6=83=85=E7=BC=BA=E5=B0=91=E3=80=90?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=B7=9F=E8=B8=AA=E3=80=91tab=EF=BC=9B3?= =?UTF-8?q?=E3=80=81=E7=94=A8=E5=88=80=E6=A0=A1=E9=AA=8C=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 7 +++++++ sf_manufacturing/views/mrp_workorder_view.xml | 6 ++++++ sf_mrs_connect/controllers/controllers.py | 1 + sf_tool_management/models/mrp_workorder.py | 7 ++++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index da54f77b..a010d2f7 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -960,6 +960,13 @@ class MrpProduction(models.Model): productions_not_delivered.write( {'state': 'progress', 'programming_state': '已编程', 'is_rework': False}) + # 对制造订单所以面的cnc工单的程序用刀进行校验 + try: + logging.info(f'已更新制造订单:{productions_not_delivered}') + productions_not_delivered.production_cnc_tool_checkout() + except Exception as e: + logging.info(f'对cnc工单的程序用刀进行校验报错:{e}') + # 从cloud获取重新编程过的最新程序 def get_new_program(self, processing_panel): try: diff --git a/sf_manufacturing/views/mrp_workorder_view.xml b/sf_manufacturing/views/mrp_workorder_view.xml index ef95a934..1398dc8a 100644 --- a/sf_manufacturing/views/mrp_workorder_view.xml +++ b/sf_manufacturing/views/mrp_workorder_view.xml @@ -584,6 +584,12 @@ position="after"> + + + mrp.group_mrp_manager,sf_base.group_sf_mrp_manager,sf_base.group_sf_equipment_user,sf_base.group_sf_order_user + + + diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index 35a7d3a3..39b4ad8a 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -104,6 +104,7 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController): # 对制造订单所以面的cnc工单的程序用刀进行校验 try: + logging.info(f'已更新制造订单:{productions}') productions.production_cnc_tool_checkout() except Exception as e: logging.info(f'对cnc工单的程序用刀进行校验报错:{e}') diff --git a/sf_tool_management/models/mrp_workorder.py b/sf_tool_management/models/mrp_workorder.py index 71a6282e..6fbd6f18 100644 --- a/sf_tool_management/models/mrp_workorder.py +++ b/sf_tool_management/models/mrp_workorder.py @@ -170,6 +170,7 @@ class MrpProduction(models.Model): # 修改cnc程序的‘刀具状态’ workorder_ids = self.env['mrp.workorder'].sudo().search([('production_id', 'in', self.ids)]) if invalid_tool: + logging.info(f'无效刀:{invalid_tool}') # 修改cnc程序的‘刀具状态’为 ‘无效刀’ cnc_ids = self.env['sf.cnc.processing'].sudo().search( [('workorder_id', 'in', workorder_ids.ids), ('cutting_tool_name', 'in', invalid_tool)]) @@ -198,12 +199,14 @@ class MrpProduction(models.Model): # 修改制造订单 编程状态变为“编程中” 制造订单状态为‘返工’ self.write({'programming_state': '编程中', 'work_state': '编程中', 'state': 'rework'}) if missing_tool_1: + logging.info(f'线边、机内缺刀:{missing_tool_1}') # 修改 修改cnc程序的‘刀具状态’ 为 ‘缺刀’ cnc_ids = self.env['sf.cnc.processing'].sudo().search( [('workorder_id', 'in', workorder_ids.ids), ('cutting_tool_name', 'in', missing_tool_1)]) if cnc_ids: cnc_ids.write({'tool_state': '1'}) - if missing_tool_2 and not invalid_tool: + if missing_tool_2 and invalid_tool != []: + logging.info(f'库存缺刀:{missing_tool_2}') # 调用CAM工单程序用刀计划创建方法 cnc_ids = self.env['sf.cnc.processing'].sudo().search( [('workorder_id', 'in', workorder_ids.filtered(lambda a: a.production_id == self[0].id).ids), @@ -211,4 +214,6 @@ class MrpProduction(models.Model): if cnc_ids: logging.info('调用CAM工单程序用刀计划创建方法!!!') self.env['sf.cam.work.order.program.knife.plan'].sudo().create_cam_work_plan(cnc_ids) + if not invalid_tool and not missing_tool_1: + logging.info('校验cnc用刀正常!!!') logging.info('工单cnc程序用刀校验完成!!!') From 53fad50af679a7d6039c9def5ebab0682620b983 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 14:22:43 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_message/data/cron_data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_message/data/cron_data.xml b/sf_message/data/cron_data.xml index f095c9bd..736e3e91 100644 --- a/sf_message/data/cron_data.xml +++ b/sf_message/data/cron_data.xml @@ -26,7 +26,7 @@ - + 检查工单是否完成并恢复正常时效 code From d25b871854146ce70d55cf1b14d6a87e460d3998 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 17 Oct 2024 14:42:35 +0800 Subject: [PATCH 17/23] 1 --- sf_tool_management/models/mrp_workorder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_tool_management/models/mrp_workorder.py b/sf_tool_management/models/mrp_workorder.py index 6fbd6f18..38d952f5 100644 --- a/sf_tool_management/models/mrp_workorder.py +++ b/sf_tool_management/models/mrp_workorder.py @@ -205,7 +205,7 @@ class MrpProduction(models.Model): [('workorder_id', 'in', workorder_ids.ids), ('cutting_tool_name', 'in', missing_tool_1)]) if cnc_ids: cnc_ids.write({'tool_state': '1'}) - if missing_tool_2 and invalid_tool != []: + if missing_tool_2 and invalid_tool == []: logging.info(f'库存缺刀:{missing_tool_2}') # 调用CAM工单程序用刀计划创建方法 cnc_ids = self.env['sf.cnc.processing'].sudo().search( From d64b48049606a3117609ef93209c0f1740ac606a Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 15:25:13 +0800 Subject: [PATCH 18/23] =?UTF-8?q?=E6=A3=80=E6=B5=8B=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B4=A8=E6=A3=80=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/security/ir.model.access.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index b929ca47..f2479fc3 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -104,6 +104,8 @@ access_mrp_production_split_group_sf_mrp_user,access.mrp.production.split,mrp.mo access_mrp_production_split_line_group_sf_mrp_user,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0 access_mrp_workcenter_capacity_manager_group_sf_mrp_user,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0 +access_sf_detection_result_group_quality,sf_detection_result_group_quality,model_sf_detection_result,sf_base.group_quality,1,0,1,0 +access_sf_detection_result_group_quality_director,sf_detection_result_group_quality_director,model_sf_detection_result,sf_base.group_quality_director,1,0,1,0 access_mrp_workcenter_productivity_loss_group_quality,mrp_workcenter_productivity_loss_group_quality,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_quality,1,0,0,0 access_mrp_workcenter_productivity_loss_group_quality_director,mrp_workcenter_productivity_loss_group_quality_director,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_quality_director,1,0,0,0 access_mrp_workcenter_productivity_group_quality,mrp_workcenter_productivity_group_quality,mrp.model_mrp_workcenter_productivity,sf_base.group_quality,1,1,1,0 From 80f0454996996cf2f44f3251be5a6c96b3969e09 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 17 Oct 2024 15:37:08 +0800 Subject: [PATCH 19/23] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B4=A8=E6=A3=80=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/security/ir.model.access.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv index f2479fc3..be71cb0d 100644 --- a/sf_manufacturing/security/ir.model.access.csv +++ b/sf_manufacturing/security/ir.model.access.csv @@ -103,7 +103,8 @@ access_mrp_production_split_multi_group_sf_mrp_user,access.mrp.production.split. access_mrp_production_split_group_sf_mrp_user,access.mrp.production.split,mrp.model_mrp_production_split,sf_base.group_sf_mrp_user,1,1,1,0 access_mrp_production_split_line_group_sf_mrp_user,access.mrp.production.split.line,mrp.model_mrp_production_split_line,sf_base.group_sf_mrp_user,1,1,1,0 access_mrp_workcenter_capacity_manager_group_sf_mrp_user,mrp.workcenter.capacity.manager,mrp.model_mrp_workcenter_capacity,sf_base.group_sf_mrp_user,1,1,1,0 - +access_mrp_workcenter_group_quality,mrp_workcenter_group_quality,model_mrp_workcenter,sf_base.group_quality,1,0,0,0 +access_mrp_workcenter_group_quality_director,mrp_workcenter_group_quality_director,model_mrp_workcenter,sf_base.group_quality_director,1,0,0,0 access_sf_detection_result_group_quality,sf_detection_result_group_quality,model_sf_detection_result,sf_base.group_quality,1,0,1,0 access_sf_detection_result_group_quality_director,sf_detection_result_group_quality_director,model_sf_detection_result,sf_base.group_quality_director,1,0,1,0 access_mrp_workcenter_productivity_loss_group_quality,mrp_workcenter_productivity_loss_group_quality,mrp.model_mrp_workcenter_productivity_loss,sf_base.group_quality,1,0,0,0 From 9e369f0150d3f6137e172d6d570fd7c01614c436 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 17 Oct 2024 15:51:00 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BAcam=E7=A8=8B=E5=BA=8F=E7=94=A8=E5=88=80?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=96=B9=E6=B3=95=E7=9A=84=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/mrp_workorder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_tool_management/models/mrp_workorder.py b/sf_tool_management/models/mrp_workorder.py index 38d952f5..d346937a 100644 --- a/sf_tool_management/models/mrp_workorder.py +++ b/sf_tool_management/models/mrp_workorder.py @@ -209,7 +209,7 @@ class MrpProduction(models.Model): logging.info(f'库存缺刀:{missing_tool_2}') # 调用CAM工单程序用刀计划创建方法 cnc_ids = self.env['sf.cnc.processing'].sudo().search( - [('workorder_id', 'in', workorder_ids.filtered(lambda a: a.production_id == self[0].id).ids), + [('workorder_id', 'in', workorder_ids.filtered(lambda a: a.production_id == self[0]).ids), ('cutting_tool_name', 'in', missing_tool_2)]) if cnc_ids: logging.info('调用CAM工单程序用刀计划创建方法!!!') From 135b97d4f89f2088dcfe5793fcecae8b9fcc414a Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 17 Oct 2024 16:00:44 +0800 Subject: [PATCH 21/23] 1 --- sf_message/models/sf_message_workorder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_message/models/sf_message_workorder.py b/sf_message/models/sf_message_workorder.py index 505b6f93..9c3cb9f5 100644 --- a/sf_message/models/sf_message_workorder.py +++ b/sf_message/models/sf_message_workorder.py @@ -12,7 +12,7 @@ class SFMessageWork(models.Model): _name = 'mrp.workorder' _inherit = ['mrp.workorder', 'jikimo.message.dispatch'] - @api.depends('production_availability', 'blocked_by_workorder_ids.state') + @api.depends('production_availability', 'blocked_by_workorder_ids.state', 'production_id.tool_state') def _compute_state(self): super(SFMessageWork, self)._compute_state() for workorder in self: From 763009a3c042ee33fd2dc274b366c651e8612265 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 17 Oct 2024 17:01:20 +0800 Subject: [PATCH 22/23] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E8=BF=94=E5=B7=A5=E6=97=B6=EF=BC=8Ccnc=E7=94=A8?= =?UTF-8?q?=E5=88=80=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index a010d2f7..dc8e82c4 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -948,6 +948,8 @@ class MrpProduction(models.Model): if production.programming_no in program_to_production_names: productions_not_delivered = self.env['mrp.production'].search( [('programming_no', '=', production.programming_no), ('programming_state', '=', '已编程未下发')]) + productions = self.env['mrp.production'].search( + [('programming_no', '=', production.programming_no), ('state', 'not in', ('cancel', 'done'))]) rework_workorder = production.workorder_ids.filtered(lambda m: m.state == 'rework') if rework_workorder: for rework_item in rework_workorder: @@ -960,12 +962,12 @@ class MrpProduction(models.Model): productions_not_delivered.write( {'state': 'progress', 'programming_state': '已编程', 'is_rework': False}) - # 对制造订单所以面的cnc工单的程序用刀进行校验 - try: - logging.info(f'已更新制造订单:{productions_not_delivered}') - productions_not_delivered.production_cnc_tool_checkout() - except Exception as e: - logging.info(f'对cnc工单的程序用刀进行校验报错:{e}') + # 对制造订单所以面的cnc工单的程序用刀进行校验 + try: + logging.info(f'已更新制造订单:{productions_not_delivered}') + productions.production_cnc_tool_checkout() + except Exception as e: + logging.info(f'对cnc工单的程序用刀进行校验报错:{e}') # 从cloud获取重新编程过的最新程序 def get_new_program(self, processing_panel): From 9bbf613bcbad90507493050339383b297cb08592 Mon Sep 17 00:00:00 2001 From: hujiaying Date: Thu, 17 Oct 2024 17:39:43 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=AE=8C=E5=B7=A5=E5=85=A5=E5=BA=93=E6=8F=90=E9=86=92=EF=BC=8C?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8F=91=E8=B4=A7=E6=8F=90=E9=86=92=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=88=B0=E8=A1=A8=E5=8D=95=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_message/models/sf_message_mrp_production.py | 12 +++++++----- sf_message/models/sf_message_stock_picking.py | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sf_message/models/sf_message_mrp_production.py b/sf_message/models/sf_message_mrp_production.py index 44a100f3..a60f2161 100644 --- a/sf_message/models/sf_message_mrp_production.py +++ b/sf_message/models/sf_message_mrp_production.py @@ -1,3 +1,4 @@ +import logging import re from odoo import models, fields, api, _ from urllib.parse import urlencode @@ -35,19 +36,20 @@ class SFMessageMrpProduction(models.Model): [('origin', '=', mrp_production.origin), ('picking_type_id.sequence_code', '=', 'SFP'), ('state', '=', 'assigned')], limit=1) if stock_picking_sfp: - url = self.request_url() + url = self.request_url(stock_picking_sfp.id) content = content.replace('{{name}}', stock_picking_sfp.name).replace( '{{sale_order_name}}', mrp_production.origin).replace('{{request_url}}', url) contents.append(content) + logging.info('生产完工入库提醒: %s' % contents) return contents - def request_url(self): + def request_url(self, id): url = self.env['ir.config_parameter'].get_param('web.base.url') - action_id = self.env.ref('mrp.mrp_production_action').id + action_id = self.env.ref('stock.action_picking_tree_all').id menu_id = self.env['ir.model.data'].search([('name', '=', 'module_theme_treehouse')]).id # 查询参数 - params = {'menu_id': menu_id, 'action': action_id, 'model': 'mrp.production', - 'view_type': 'kanban'} + params = {'id': id, 'menu_id': menu_id, 'action': action_id, 'model': 'mrp.production', + 'view_type': 'form'} # 拼接查询参数 query_string = urlencode(params) # 拼接URL diff --git a/sf_message/models/sf_message_stock_picking.py b/sf_message/models/sf_message_stock_picking.py index d98b475f..9d7c7f0e 100644 --- a/sf_message/models/sf_message_stock_picking.py +++ b/sf_message/models/sf_message_stock_picking.py @@ -1,3 +1,4 @@ +import logging import re from odoo import models, fields, api, _ from urllib.parse import urlencode @@ -40,9 +41,10 @@ class SFMessageStockPicking(models.Model): ('picking_type_id.sequence_code', '=', 'OUT')]) if stock_picking_out and len(stock_picking_out) > 0: content = message_queue_id.message_template_id.content - url = self.request_url() + url = self.request_url1(stock_picking_out.id) content = content.replace('{{name}}', stock_picking_out.name).replace( '{{sale_order_name}}', stock_picking_out.origin).replace('{{request_url}}', url) + logging.info('订单发货提醒: %s' % content) return content def _get_message(self, message_queue_ids): @@ -96,3 +98,16 @@ class SFMessageStockPicking(models.Model): # 拼接URL full_url = url + "/web#" + query_string return full_url + + def request_url1(self, id): + url = self.env['ir.config_parameter'].get_param('web.base.url') + action_id = self.env.ref('stock.action_picking_tree_all').id + menu_id = self.env['ir.model.data'].search([('name', '=', 'module_theme_treehouse')]).id + # 查询参数 + params = {'id': id, 'menu_id': menu_id, 'action': action_id, 'model': 'stock.picking', + 'view_type': 'form'} + # 拼接查询参数 + query_string = urlencode(params) + # 拼接URL + full_url = url + "/web#" + query_string + return full_url