From 939f3d58f434e377ecac1360b4ab8fdc3e29ea84 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Wed, 16 Oct 2024 11:41:15 +0800 Subject: [PATCH 1/8] =?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 2/8] =?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 3/8] =?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 4/8] =?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 5/8] =?UTF-8?q?Merge=20branch=20'develop'=20of=20https://e?= =?UTF-8?q?.coding.net/jikimo-hn/jikimo=5Fsfs/jikimo=5Fsf=20into=20feature?= =?UTF-8?q?/=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 6/8] =?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 7/8] =?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 8/8] =?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 @@ - - + +