From 4f898dd8ceac93cc73f5e27aca1f375b9c22eeeb Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 8 Nov 2023 17:29:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=EF=BC=8C=E7=A1=AC=E5=BA=A6=E7=9A=84=E5=AD=97=E6=AE=B5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=94=B9=E4=B8=BA=E6=95=B4=E6=95=B0=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/models/common.py | 2 +- sf_base/models/tool_other_features.py | 2 +- sf_manufacturing/models/product_template.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sf_base/models/common.py b/sf_base/models/common.py index e781d10d..f116b50f 100644 --- a/sf_base/models/common.py +++ b/sf_base/models/common.py @@ -73,7 +73,7 @@ class MrsMaterialModel(models.Model): price = fields.Float('单价/kg') apply = fields.Many2many('material.apply', string='材料应用') materials_code = fields.Char('材料代号') - hardness = fields.Float("硬度(hrc)") + hardness = fields.Integer("硬度(hrc)") rough_machining = fields.Float("粗加工Vc(m/min)") finish_machining = fields.Float("精加工Vc(m/min)") remark = fields.Text("备注") diff --git a/sf_base/models/tool_other_features.py b/sf_base/models/tool_other_features.py index 0889f087..7bb94711 100644 --- a/sf_base/models/tool_other_features.py +++ b/sf_base/models/tool_other_features.py @@ -299,7 +299,7 @@ class CuttingSpeed(models.Model): slope_milling_angle = fields.Integer('坡铣角度(°)') material_grade = fields.Char('材料牌号') tensile_strength = fields.Char('拉伸强度 (N/mm²)') - hardness = fields.Float('硬度(HRC)') + hardness = fields.Integer('硬度(HRC)') cutting_speed_n1 = fields.Char('径向切宽 ae=100%D1 ap=1*D1 切削速度Vc') cutting_speed_n2 = fields.Char('径向切宽 ae=50%D1 ap=1.5*D1 切削速度Vc') cutting_speed_n3 = fields.Char('径向切宽 ae=25%D1 ap=L1max 切削速度Vc') diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 29f5c063..e7ec3bec 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -3,8 +3,8 @@ from odoo import models, fields, api, _ from odoo.exceptions import ValidationError from odoo.modules import get_resource_path from odoo.addons.sf_base.commons.common import Common -# 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 import logging import base64 import hashlib From 6335c03cefed9886916528cf8f9944b9586b16fb Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 8 Nov 2023 17:35:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=A1=AC=E5=BA=A6=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84=E7=B1=BB=E5=9E=8B=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=95=B4=E6=95=B0=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 2 +- sf_tool_management/models/tool_material_search.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index e7ec3bec..58c9f876 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -437,7 +437,7 @@ class ResProductMo(models.Model): cutting_tool_thickness_tolerance = fields.Char('厚度公差(mm)', size=20) cutting_tool_jump_accuracy = fields.Char('径跳精度(mm)') - cutting_tool_working_hardness = fields.Char('加工硬度(hrc)') + cutting_tool_working_hardness = fields.Integer('加工硬度(hrc)') cutting_tool_cutter_bar_ids = fields.Many2many( 'sf.cutting_tool.standard.library', relation='product_cutting_tool_library_cutter_bar_rel', diff --git a/sf_tool_management/models/tool_material_search.py b/sf_tool_management/models/tool_material_search.py index 32b4d6a8..aad862b6 100644 --- a/sf_tool_management/models/tool_material_search.py +++ b/sf_tool_management/models/tool_material_search.py @@ -49,7 +49,7 @@ class SfToolMaterialSearch(models.Model): blade_rear_angle = fields.Float('刀片后角(°)') blade_main_included_angle = fields.Float('刀片主偏角(°)') blade_r_angle = fields.Float('刀片R角(°)') - blade_hardness = fields.Char('刀片加工硬度') + blade_hardness = fields.Integer('刀片加工硬度') blade_accuracy = fields.Char('刀片精度等级') blade_coating_material_id = fields.Char('刀片涂层材质') blade_radius = fields.Float('刀片刀尖半径(mm)') @@ -215,7 +215,7 @@ class SfToolMaterialSearch(models.Model): bar_screw = fields.Float('刀杆配备螺丝(mm)') bar_radius = fields.Float('刀杆刀尖圆角半径') bar_accuracy = fields.Char('刀杆精度等级') - bar_hardness = fields.Char('刀杆硬度(°)') + bar_hardness = fields.Integer('刀杆硬度(°)') bar_scope = fields.Char('刀杆适用范围') # 刀盘特有字段 @@ -237,7 +237,7 @@ class SfToolMaterialSearch(models.Model): pad_screw = fields.Float('刀盘配备螺丝(mm)') pad_radius = fields.Float('刀盘刀尖圆角半径') pad_accuracy = fields.Char('刀盘精度等级') - pad_hardness = fields.Char('刀盘硬度(°)') + pad_hardness = fields.Integer('刀盘硬度(°)') pad_scope = fields.Char('刀盘适用范围') # 刀柄特有字段 @@ -265,7 +265,7 @@ class SfToolMaterialSearch(models.Model): ) handle_clamping_range = fields.Float('刀柄夹持范围(mm)') handle_detection_accuracy = fields.Float('刀柄检测精度') - handle_detection_hardness = fields.Char('刀柄检测硬度') + handle_detection_hardness = fields.Integer('刀柄检测硬度') handle_standard_speed = fields.Float('刀柄标准转速') # 夹头特有字段 From 01f09029376f106873f8f4f715a7b509807b8a42 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 8 Nov 2023 17:41:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=EF=BC=8C=E5=8F=8A=E4=BF=AE=E6=94=B9=E8=BD=AC=E6=8D=A23d?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=96=87=E4=BB=B6=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {sf_dlm => sf_base}/static/util/stl2gltf.py | 0 sf_manufacturing/models/product_template.py | 2 +- sf_sale/models/quick_easy_order.py | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) rename {sf_dlm => sf_base}/static/util/stl2gltf.py (100%) diff --git a/sf_dlm/static/util/stl2gltf.py b/sf_base/static/util/stl2gltf.py similarity index 100% rename from sf_dlm/static/util/stl2gltf.py rename to sf_base/static/util/stl2gltf.py diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 58c9f876..b6961fda 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -863,7 +863,7 @@ class ResProductMo(models.Model): # write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) # 转化为glb output_glb_file = os.path.join('/tmp', str(code) + '.glb') - util_path = get_resource_path('sf_dlm', 'static/util') + util_path = get_resource_path('sf_base', 'static/util') cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file) os.system(cmd) # 转base64 diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 238bb5d8..e9f152a8 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -1,7 +1,7 @@ from odoo import models, fields, api 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 from odoo.exceptions import ValidationError, UserError from odoo.addons.sf_base.commons.common import Common from datetime import datetime @@ -95,7 +95,7 @@ class QuickEasyOrder(models.Model): write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) # 转化为glb output_glb_file = os.path.join('/tmp', str(model_code) + '.glb') - util_path = get_resource_path('sf_dlm', 'static/util') + util_path = get_resource_path('sf_base', 'static/util') cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file) os.system(cmd) # 转base64