From 7713ade077420c36f44d9b8f93dfb840085261bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?WEB=E8=AE=B8=E4=BD=95=E5=93=B2=5Cxuhez?= Date: Tue, 29 Aug 2023 15:13:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?sf=E5=93=81=E7=89=8C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=A0=B7=E5=BC=8F=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/static/src/scss/test.scss | 18 ++++++++++++ sf_manufacturing/models/product_template.py | 32 ++++++++++----------- 2 files changed, 34 insertions(+), 16 deletions(-) diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss index faef4815..3868fb09 100644 --- a/sf_base/static/src/scss/test.scss +++ b/sf_base/static/src/scss/test.scss @@ -119,4 +119,22 @@ td.o_required_modifier { .o_kanban_record_bottom { font-family: '华文中宋'; //font-weight: bold; +} + +.o_list_table th > div > i { + display: none !important; +} + +body .o_list_table th:nth-child(4) { + width: 100px !important; +} + +//body .o_list_table th:nth-child(5) { +// width: 500px !important; +//} + +.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove).o_list_text { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } \ No newline at end of file diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index dbeb7814..16e65e85 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 @@ -566,20 +566,20 @@ class ResProductMo(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 class ResMrpBomMo(models.Model): From b7f2c4a000d404acdaf045f8a784350c3fe306a2 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Tue, 29 Aug 2023 15:47:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?sf=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87table?= =?UTF-8?q?=EF=BC=8C=E5=93=81=E7=89=8C=E5=9B=BE=E7=89=87=E6=94=B9=E6=88=90?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/models/base.py | 2 +- sf_maintenance/views/maintenance_views.xml | 28 ++++++++++++------ sf_manufacturing/models/product_template.py | 32 ++++++++++----------- 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/sf_base/models/base.py b/sf_base/models/base.py index 042b77f4..13465eb8 100644 --- a/sf_base/models/base.py +++ b/sf_base/models/base.py @@ -35,7 +35,7 @@ class MachineBrand(models.Model): code = fields.Char('编码') name = fields.Char('名称') tag_ids = fields.Many2many('sf.machine.brand.tags', 'rel_machine_brand_tags', string='类别') - image_brand = fields.Image("品牌图片") + image_brand = fields.Image("图片") remark = fields.Text('备注') active = fields.Boolean('有效', default=True) diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml index 8f835c4c..4c874494 100644 --- a/sf_maintenance/views/maintenance_views.xml +++ b/sf_maintenance/views/maintenance_views.xml @@ -171,12 +171,7 @@ - - - - -