From d2c5fdb50903e99325eb97e636193bd61b93359a Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 29 Aug 2024 18:18:19 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 83e4026a..dd86621b 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -690,11 +690,12 @@ class MrpProduction(models.Model): raise ValidationError('该产品【加工面板】为空!') else: raise ValidationError('该产品没有选择【模版类型】!') - + logging.info('sequence_list: %s' % sequence_list) for work in rec.workorder_ids: work_name = work.name - if '-' in work.name: - work_name = work.name.split('-')[0] + if '-' in work_name: + work_name = work_name.split('-')[0] + logging.info(work_name) if sequence_list.get(work_name): work.sequence = sequence_list[work_name] elif sequence_list.get(work.processing_panel): @@ -727,8 +728,8 @@ class MrpProduction(models.Model): panel_sequence_list.update({tmpl_id.route_workcenter_id.name: sequence_max}) for work_id in work_ids: work_name = work_id.name - if '-' in work_id.name: - work_name = work_id.name.split('-')[0] + if '-' in work_name: + work_name = work_name.split('-')[0] if panel_sequence_list.get(work_name): work_id.sequence = panel_sequence_list[work_name] From 1b710b205f247267bec7c3b40bc222c240a4115a Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 29 Aug 2024 19:23:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index dd86621b..8e6fe9b7 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -664,7 +664,7 @@ class MrpProduction(models.Model): # 表面工艺工序 # 模型类型的表面工艺工序模版 surface_tmpl_ids = model_type_id.surface_technics_routing_tmpl_ids - # 产品选择的表面工艺 + # 产品选择的表面工艺参数 model_process_parameters_ids = rec.product_id.model_process_parameters_ids process_dict = {} if model_process_parameters_ids: @@ -673,7 +673,7 @@ class MrpProduction(models.Model): for surface_tmpl_id in surface_tmpl_ids: if process_id == surface_tmpl_id.route_workcenter_id.surface_technics_id: surface_tmpl_name = surface_tmpl_id.route_workcenter_id.name - process_dict.update({int(process_id.category_id.code): '%s-%s' % ( + process_dict.update({int(process_id.code): '%s-%s' % ( surface_tmpl_name, process_parameters_id.name)}) process_list = sorted(process_dict.keys()) for process_num in process_list: @@ -693,8 +693,6 @@ class MrpProduction(models.Model): logging.info('sequence_list: %s' % sequence_list) for work in rec.workorder_ids: work_name = work.name - if '-' in work_name: - work_name = work_name.split('-')[0] logging.info(work_name) if sequence_list.get(work_name): work.sequence = sequence_list[work_name] @@ -728,8 +726,6 @@ class MrpProduction(models.Model): panel_sequence_list.update({tmpl_id.route_workcenter_id.name: sequence_max}) for work_id in work_ids: work_name = work_id.name - if '-' in work_name: - work_name = work_name.split('-')[0] if panel_sequence_list.get(work_name): work_id.sequence = panel_sequence_list[work_name] From f251878637d94cacfd2775d1ba786b7aeab83f45 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 29 Aug 2024 19:53:37 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F,=E4=BC=98=E5=8C=96=E8=A1=A8=E9=9D=A2?= =?UTF-8?q?=E5=B7=A5=E8=89=BA=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/models/common.py | 1 + sf_base/views/common_view.xml | 2 +- sf_manufacturing/models/mrp_production.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sf_base/models/common.py b/sf_base/models/common.py index c2858b95..95572631 100644 --- a/sf_base/models/common.py +++ b/sf_base/models/common.py @@ -84,6 +84,7 @@ class MrsProductionProcessCategory(models.Model): class MrsProductionProcess(models.Model): _name = 'sf.production.process' _description = '表面工艺' + order = 'sequence asc' code = fields.Char("编码") name = fields.Char('名称') diff --git a/sf_base/views/common_view.xml b/sf_base/views/common_view.xml index 334eaa32..c529354f 100644 --- a/sf_base/views/common_view.xml +++ b/sf_base/views/common_view.xml @@ -165,7 +165,7 @@ sf.production.process - + diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 8e6fe9b7..5095556d 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -673,7 +673,7 @@ class MrpProduction(models.Model): for surface_tmpl_id in surface_tmpl_ids: if process_id == surface_tmpl_id.route_workcenter_id.surface_technics_id: surface_tmpl_name = surface_tmpl_id.route_workcenter_id.name - process_dict.update({int(process_id.code): '%s-%s' % ( + process_dict.update({int(process_id.sequence): '%s-%s' % ( surface_tmpl_name, process_parameters_id.name)}) process_list = sorted(process_dict.keys()) for process_num in process_list: From 5121e455d2293925ab47d7e0742d5bf58abec6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Thu, 29 Aug 2024 20:20:39 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9agv=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AF=B7=E6=B1=82=E6=8E=88=E6=9D=83=E7=94=A8?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/controllers/controllers.py | 6 +++--- sf_manufacturing/controllers/workpiece.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sf_manufacturing/controllers/controllers.py b/sf_manufacturing/controllers/controllers.py index 23be7d38..632e9e4c 100644 --- a/sf_manufacturing/controllers/controllers.py +++ b/sf_manufacturing/controllers/controllers.py @@ -477,7 +477,7 @@ class Manufacturing_Connect(http.Controller): logging.info('LocationChange error:%s' % e) return json.JSONEncoder().encode(res) - @http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False, + @http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False, cors="*") def AGVToProduct(self, **kw): """ @@ -549,7 +549,7 @@ class Manufacturing_Connect(http.Controller): logging.info('AGVToProduct error:%s' % e) return json.JSONEncoder().encode(res) - @http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False, + @http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False, cors="*") def AGVDownProduct(self, **kw): """ @@ -668,7 +668,7 @@ class Manufacturing_Connect(http.Controller): logging.info('AGVDownProduct error:%s' % e) return json.JSONEncoder().encode(res) - @http.route('/AutoDeviceApi/AgvStationState', type='json', auth='none', methods=['GET', 'POST'], csrf=False, + @http.route('/AutoDeviceApi/AgvStationState', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False, cors="*") def AGVStationState(self, **kw): """ diff --git a/sf_manufacturing/controllers/workpiece.py b/sf_manufacturing/controllers/workpiece.py index 5d79a1b3..370c71a0 100644 --- a/sf_manufacturing/controllers/workpiece.py +++ b/sf_manufacturing/controllers/workpiece.py @@ -8,7 +8,7 @@ from odoo.http import request class Workpiece(http.Controller): - @http.route('/agvApi/backfeed', type='json', auth='none', methods=['GET', 'POST'], csrf=False, + @http.route('/agvApi/backfeed', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False, cors="*") def backfeed(self, **kw): """ From 0ef46407dd451907fbdc6e57f67250f306467a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Fri, 30 Aug 2024 09:35:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=B0=86agv=E5=9B=9E=E8=B0=83=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=8E=88=E6=9D=83=E6=94=B9=E4=B8=BAnone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/controllers/workpiece.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/controllers/workpiece.py b/sf_manufacturing/controllers/workpiece.py index 370c71a0..5d79a1b3 100644 --- a/sf_manufacturing/controllers/workpiece.py +++ b/sf_manufacturing/controllers/workpiece.py @@ -8,7 +8,7 @@ from odoo.http import request class Workpiece(http.Controller): - @http.route('/agvApi/backfeed', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False, + @http.route('/agvApi/backfeed', type='json', auth='none', methods=['GET', 'POST'], csrf=False, cors="*") def backfeed(self, **kw): """