diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py index 2c05e1a2..65b76795 100644 --- a/sf_base/__manifest__.py +++ b/sf_base/__manifest__.py @@ -30,7 +30,7 @@ 'web.assets_qweb': [ ], 'web.assets_backend': [ - 'sf_base/static/src/scss/format_img.scss', + 'sf_base/static/src/scss/*.scss', ], }, diff --git a/sf_base/models/base.py b/sf_base/models/base.py index aeb0c0ac..57453d56 100644 --- a/sf_base/models/base.py +++ b/sf_base/models/base.py @@ -85,7 +85,7 @@ class MachineTool(models.Model): [("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")], default='正常', string="机床状态") #0606新增字段 - machine_tool_picture = fields.Binary('机床图片') + machine_tool_picture = fields.Binary('图片') heightened_way = fields.Selection([ ('sifudianji', '伺服电机驱动'), ('youyagang', '油压缸驱动'), @@ -260,7 +260,7 @@ class MachineToolType(models.Model): rotate_speed = fields.Integer('转速') #0606新增字段 created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user) - machine_tool_picture = fields.Binary('机床图片') + machine_tool_picture = fields.Binary('图片') heightened_way = fields.Selection([ ('sifudianji', '伺服电机驱动'), ('youyagang', '油压缸驱动'), diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss new file mode 100644 index 00000000..32aba96d --- /dev/null +++ b/sf_base/static/src/scss/test.scss @@ -0,0 +1,7 @@ +.test_model { + display: flex !important; +} +.test_model>.o_form_label { + margin-left: 20px; + margin-right: 0px !important; +} \ No newline at end of file diff --git a/sf_base/views/base_view.xml b/sf_base/views/base_view.xml index 75d481c8..1b51900c 100644 --- a/sf_base/views/base_view.xml +++ b/sf_base/views/base_view.xml @@ -96,23 +96,25 @@ - + form.sf.machine_tool.type sf.machine_tool.type
- + - - - + + + + + @@ -177,6 +179,7 @@ + 机床型号 ir.actions.act_window @@ -249,7 +252,7 @@ tree,form

- [机床型号] 还没有哦!点左上角的[创建]按钮,沙发归你了! + [机床类型] 还没有哦!点左上角的[创建]按钮,沙发归你了!

diff --git a/sf_base/views/tool_base_views.xml b/sf_base/views/tool_base_views.xml index 2d4a88fb..382c4647 100644 --- a/sf_base/views/tool_base_views.xml +++ b/sf_base/views/tool_base_views.xml @@ -53,10 +53,26 @@ sf.functional.cutting.tool - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 5653ac7b..d15741e9 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -1,8 +1,8 @@ from odoo import models, fields, api from odoo.exceptions import ValidationError 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 import logging import base64 import hashlib @@ -468,20 +468,20 @@ class ResProductTemplate(models.Model): item.model_file = self.transition_glb_file(report_path, model_code) # 将attach的datas内容转为glb文件 - def transition_glb_file(self, report_path, code): - shapes = read_step_file(report_path) - output_file = os.path.join('/tmp', str(code) + '.stl') - 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') - cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file) - os.system(cmd) - # 转base64 - with open(output_glb_file, 'rb') as fileObj: - image_data = fileObj.read() - base64_data = base64.b64encode(image_data) - return base64_data + # def transition_glb_file(self, report_path, code): + # shapes = read_step_file(report_path) + # output_file = os.path.join('/tmp', str(code) + '.stl') + # 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') + # cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file) + # os.system(cmd) + # # 转base64 + # with open(output_glb_file, 'rb') as fileObj: + # image_data = fileObj.read() + # base64_data = base64.b64encode(image_data) + # return base64_data @api.onchange('integral_cutting_tool_type_id') def _get_integral_cutting_tool_type_info(self): diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py index 691b7268..ae13cb56 100644 --- a/sf_tool_management/models/base.py +++ b/sf_tool_management/models/base.py @@ -58,6 +58,29 @@ class FunctionalCuttingToolEntity(models.Model): total = fields.Text(string='总计') # remark = fields.Text(string='备注/说明') + # @api.onchange('functional_cutting_tool_id') + # def get_functional_cutting_tool_info(self): + # for item in self: + # item.code = item.functional_cutting_tool_id.code, + # item.name = item.functional_cutting_tool_id.name, + # item.functional_model_number = item.functional_cutting_tool_id.functional_model_number, + # item.integral_model_number = item.functional_cutting_tool_id.integral_model_number, + # item.blade_model_number = item.functional_cutting_tool_id.blade_model_number, + # item.cutterbar_model_number = item.functional_cutting_tool_id.cutterbar_model_number, + # item.cutterpad_model_number = item.functional_cutting_tool_id.cutterpad_model_number, + # item.handle_model_number = item.functional_cutting_tool_id.handle_model_number, + # item.chuck_model_number = item.functional_cutting_tool_id.chuck_model_number, + # item.diameter = item.functional_cutting_tool_id.diameter, + # item.tool_grade = item.functional_cutting_tool_id.tool_grade, + # item.machining_accuracy = item.functional_cutting_tool_id.machining_accuracy, + # item.ctool_lengthode = item.functional_cutting_tool_id.tool_length, + # item.blade_number = item.functional_cutting_tool_id.blade_number, + # item.integral_blade_length = item.functional_cutting_tool_id.integral_blade_length, + # item.effective_blade_length = item.functional_cutting_tool_id.effective_blade_length, + # item.max_life = item.functional_cutting_tool_id.max_life, + # item.is_standard = item.functional_cutting_tool_id.is_standard, + # item.applicable_range = item.functional_cutting_tool_id.applicable_range, + @api.model def create(self, vals): diff --git a/sf_tool_management/views/menu_view.xml b/sf_tool_management/views/menu_view.xml index 2abf6a11..5791bf90 100644 --- a/sf_tool_management/views/menu_view.xml +++ b/sf_tool_management/views/menu_view.xml @@ -21,7 +21,7 @@ parent="menu_sf_tool_manage" name="功能刀具列表" sequence="3" - action="sf_base.action_sf_functional_cutting_tool" + action="sf_function_tool_entry_list_view_act" /> @@ -29,8 +29,8 @@ id="menu_sf_functional_cutting_tool_warning" parent="menu_sf_tool_manage" name="功能刀具预警" - sequence="3" - action="action_sf_functional_cutting_tool_warning" + sequence="4" + action="sf_function_tool_entry_warning_view_act" /> + + + sf.functional.cutting.tool.entity.list.tree + sf.functional.cutting.tool.entity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 功能刀具列表 + ir.actions.act_window + sf.functional.cutting.tool.entity + tree + + + sf.functional.cutting.tool.entity.tree @@ -36,6 +75,14 @@
+ + 功能刀具预警 + ir.actions.act_window + sf.functional.cutting.tool.entity + tree + + + 功能刀具出入库记录