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_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 29f5c063..b6961fda 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 @@ -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', @@ -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 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('刀柄标准转速') # 夹头特有字段