From 3225916629424c1170a565507d11e8880038576b Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 7 Sep 2023 17:46:22 +0800 Subject: [PATCH 1/7] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=9A=20=E2=91=A0=E2=80=9C=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E7=B1=BB=E5=88=AB=E2=80=9D=E5=AD=97=E6=AE=B5=E6=94=BE?= =?UTF-8?q?=E5=9C=A8=E5=BC=80=E7=A5=A8=E7=AD=96=E7=95=A5=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=EF=BC=9B=E2=80=9C=E5=86=85=E9=83=A8=E7=BC=96=E7=A0=81=E2=80=9D?= =?UTF-8?q?=E5=92=8C=E2=80=9C=E6=9D=A1=E7=A0=81=E2=80=9D=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=94=BE=E5=9C=A8=E4=BA=A7=E5=93=81=E6=A0=87=E7=AD=BE=E5=90=8E?= =?UTF-8?q?=E9=9D=A2=EF=BC=9B=E5=BD=93=E2=80=9C=E4=BA=A7=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E5=88=AB=E2=80=9D=E4=B8=BA=E2=80=9C=E6=88=90=E5=93=81=E2=80=9D?= =?UTF-8?q?=E6=97=B6=E2=80=9C=E4=B8=8A=E4=BC=A0=E6=A8=A1=E5=9E=8B=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E2=80=9C=E5=92=8C=E2=80=9C=E6=A8=A1=E5=9E=8B=E2=80=9C?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=94=BE=E5=9C=A8"=E9=94=80=E5=94=AE?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC"=E5=89=8D=E9=9D=A2=EF=BC=9B=20=E2=91=A1?= =?UTF-8?q?=E5=BD=93=E2=80=9C=E4=BA=A7=E5=93=81=E7=B1=BB=E5=88=AB=E2=80=9D?= =?UTF-8?q?=E4=B8=BA=E2=80=9C=E5=88=80=E5=85=B7=E2=80=9D=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E2=80=9C=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99=E2=80=9D?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=BA=E2=80=9C=E6=95=B4=E4=BD=93=E5=BC=8F?= =?UTF-8?q?=E5=88=80=E5=85=B7=E2=80=9D,"=E5=88=80=E6=9F=84"=E6=88=96"?= =?UTF-8?q?=E5=A4=B9=E5=A4=B4"=E6=97=B6=EF=BC=8C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E9=80=89=E6=8B=A9=E7=9A=84=E5=88=80=E5=85=B7?= =?UTF-8?q?=E7=89=A9=E6=96=99=E8=80=8C=E6=96=B0=E5=A2=9E=E6=89=80=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E9=9C=80=E8=A6=81=E7=9A=84=E5=AD=97=E6=AE=B5=E5=8F=8A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=E5=B1=95=E7=A4=BA=202.?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E4=BA=A7=E5=93=81=E6=97=B6=EF=BC=8C=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E7=9A=84=E2=80=9C=E4=BA=A7=E5=93=81=E7=B1=BB=E5=88=AB?= =?UTF-8?q?=E2=80=9D=E4=B8=BA=E2=80=9D=E5=88=80=E5=85=B7=E2=80=9C=E4=B8=94?= =?UTF-8?q?=E2=80=9C=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99=E2=80=9D=E4=B8=BA?= =?UTF-8?q?=E2=80=9C=E6=95=B4=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7=E2=80=9D?= =?UTF-8?q?,"=E5=88=80=E6=9F=84"=E6=88=96"=E5=A4=B9=E5=A4=B4"=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E6=94=B6=E8=B4=A7=E5=8D=95=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E6=93=8D=E4=BD=9C=E6=97=B6=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=AE=9E=E6=97=B6=E6=B3=A8=E5=86=8C=E5=88=B0Cloud?= =?UTF-8?q?=E7=9A=84=E5=8A=A8=E6=80=81=E8=B5=84=E6=BA=90=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E5=8E=82=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=203.=E4=BC=98=E5=8C=96=E2=80=9C=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=A8=A1=E6=9D=BF"=E6=A8=A1=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/static/src/scss/test.scss | 15 + sf_dlm/views/product_template_view.xml | 310 ++++++++++---- sf_manufacturing/models/product_template.py | 440 +++++++++++--------- sf_manufacturing/models/stock.py | 59 ++- 4 files changed, 515 insertions(+), 309 deletions(-) diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss index 39c5250f..a54eb808 100644 --- a/sf_base/static/src/scss/test.scss +++ b/sf_base/static/src/scss/test.scss @@ -146,4 +146,19 @@ td.o_required_modifier { display: flex; flex-direction: row-reverse; justify-content: flex-start; +} + +.diameter:before { + content:"Ф"; + display:inline; +} +.diameter{ + display: flex !important; + justify-content: flex-start !important; + align-items: center !important; +} +.o_address_format { + display: flex !important; + justify-content: flex-start !important; + align-items: center !important; } \ No newline at end of file diff --git a/sf_dlm/views/product_template_view.xml b/sf_dlm/views/product_template_view.xml index c7622563..5c858f9a 100644 --- a/sf_dlm/views/product_template_view.xml +++ b/sf_dlm/views/product_template_view.xml @@ -1,47 +1,68 @@ + + product.template.only.form.inherit.sf + product.template + + + + + + + + + + + product.template.form.inherit.sf product.template - + + + + + + + + - + - - - - + - - + - - - + + + + + + 每齿走刀量fz + sf.feed.per.tooth + + + + + + + + + + + + + 每齿走刀量fz + ir.actions.act_window + sf.feed.per.tooth + tree + \ No newline at end of file diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index eed2be57..625e21a2 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 @@ -86,22 +86,22 @@ class QuickEasyOrder(models.Model): return obj # 将attach的datas内容转为glb文件 - def transition_glb_file(self, report_path, model_code): - shapes = read_step_file(report_path) - # output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl') - output_file = os.path.join('/tmp', str(model_code) + '.stl') - write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) - # 转化为glb - # output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb') - output_glb_file = os.path.join('/tmp', str(model_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, model_code): + # shapes = read_step_file(report_path) + # # output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl') + # output_file = os.path.join('/tmp', str(model_code) + '.stl') + # write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) + # # 转化为glb + # # output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb') + # output_glb_file = os.path.join('/tmp', str(model_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 # return False diff --git a/sf_tool_management/models/tool_material_search.py b/sf_tool_management/models/tool_material_search.py index c58d0e6f..ab9c24f7 100644 --- a/sf_tool_management/models/tool_material_search.py +++ b/sf_tool_management/models/tool_material_search.py @@ -102,6 +102,9 @@ class SfToolMaterialSearch(models.Model): cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction', '走刀方向') suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant', '适合冷却液') + cutting_speed_ids = fields.Many2many('sf.cutting.speed', string='切削速度Vc') + feed_per_tooth_ids = fields.Many2many('sf.feed.per.tooth', 'rel_feed_per_tooth_ids', '每齿走刀量fz') + @api.constrains('suitable_machining_method_ids') def _check_suitable_machining_method_ids(self): for record in self: diff --git a/sf_tool_management/views/tool_material_search.xml b/sf_tool_management/views/tool_material_search.xml index 7ed97d1d..594073ff 100644 --- a/sf_tool_management/views/tool_material_search.xml +++ b/sf_tool_management/views/tool_material_search.xml @@ -240,6 +240,12 @@ + + + + + + From b12880da502b18f53801a2b0352bedba273daa71 Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Fri, 8 Sep 2023 10:39:47 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=94=BE=E5=BC=80OCC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 32 +++++++++--------- sf_sale/models/quick_easy_order.py | 36 ++++++++++----------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index a55ebef8..c26181d1 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 @@ -663,20 +663,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): diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 625e21a2..eed2be57 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 @@ -86,22 +86,22 @@ class QuickEasyOrder(models.Model): return obj # 将attach的datas内容转为glb文件 - # def transition_glb_file(self, report_path, model_code): - # shapes = read_step_file(report_path) - # # output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl') - # output_file = os.path.join('/tmp', str(model_code) + '.stl') - # write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) - # # 转化为glb - # # output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb') - # output_glb_file = os.path.join('/tmp', str(model_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, model_code): + shapes = read_step_file(report_path) + # output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl') + output_file = os.path.join('/tmp', str(model_code) + '.stl') + write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) + # 转化为glb + # output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb') + output_glb_file = os.path.join('/tmp', str(model_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 # return False From e50f0c44654c6138fe86db4dceb28d9b9202543e Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Fri, 8 Sep 2023 14:10:48 +0800 Subject: [PATCH 4/7] =?UTF-8?q?Merge=20branch=20'develop'=20of=20https://e?= =?UTF-8?q?.coding.net/jikimo-hn/jikimo=5Fsfs/jikimo=5Fsf=20into=20feature?= =?UTF-8?q?/=E5=88=80=E6=9F=84=E5=92=8C=E5=A4=B9=E5=A4=B4=E5=8F=8D?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=88=B0Cloud=E7=94=9F=E6=88=90=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Conflicts: # sf_manufacturing/models/product_template.py --- sf_manufacturing/models/product_template.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 9729d1c9..1d1ed2ba 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -761,8 +761,7 @@ class ResMrpBomMo(models.Model): } return self.env['mrp.bom.line'].create(vals) - # 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom - + # 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品后再次进行创建bom def bom_create(self, product, bom_type, product_type): bom_id = self.env['mrp.bom'].create({ 'product_tmpl_id': product.product_tmpl_id.id, @@ -779,7 +778,6 @@ class ResMrpBomMo(models.Model): # 坯料BOM组件:选取当前坯料原材料, # 然后根据当前的坯料的体积得出需要的原材料重量(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤) # 坯料所需原材料公式:当前的坯料的体积(立方米m³) *材料密度 * 1000 = 所需原材料重量KG(公斤) - def bom_create_line(self, embryo): # 选取当前坯料原材料 raw_bom_line = self.get_raw_bom(embryo) @@ -826,8 +824,7 @@ class ResMrpBomMo(models.Model): else: return - # 查bom的原材料 - + # 查bom的原材料 def get_raw_bom(self, product): raw_bom = self.env['product.product'].search( [('categ_id.type', '=', '原材料'), ('materials_type_id', '=', product.materials_type_id.id)]) From b76c192f3349fcf7fa60fd918702e41993c2d2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?WEB=E8=AE=B8=E4=BD=95=E5=93=B2=5Cxuhez?= Date: Fri, 8 Sep 2023 16:31:06 +0800 Subject: [PATCH 5/7] =?UTF-8?q?many2many=E5=9B=BE=E6=96=87=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=8F=8A=E7=82=B9=E5=87=BB=E4=BA=A4=E4=BA=92=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_frontend/__manifest__.py | 2 +- .../custom_many2many_checkboxes.css | 39 ++++++++++++++++- .../custom_many2many_checkboxes.js | 43 ++++++++++++------- .../custom_many2many_checkboxes.xml | 17 ++++---- 4 files changed, 74 insertions(+), 27 deletions(-) diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py index fc3c7549..716bc918 100644 --- a/jikimo_frontend/__manifest__.py +++ b/jikimo_frontend/__manifest__.py @@ -22,7 +22,7 @@ ], 'web.assets_backend': [ 'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*', - 'jikimo_frontend/static/src/scss/test.scss', + 'jikimo_frontend/static/src/scss/custom_style.scss', ], }, diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css index de17fabb..df6cdfb6 100644 --- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css @@ -1,6 +1,41 @@ .zoomed { - position: fixed; + position: fixed !important; top: 50%; left: 50%; - transform: translate(-50%, -50%) scale(20); + transform: translate(-50%, -50%) scale(10); } + +.many2many_flex { + display: flex; +} + +.many2many_flex>div { + margin-right: 15px; + display: flex; + flex-direction: column; + align-items: center; +} + +.many2many_flex>div>:nth-child(2) { + position: relative; +} + +.close { + width: 20px; + height: 20px; + position: absolute; + top: -8.8px; + right: -8.8px; + color: #fff; + background-color: #000; + opacity: 0; + text-align: center; + line-height: 20px; + font-size: 18px; +} + +.img_close { + opacity: 1; + transform: scale(0.1); + cursor: pointer; +} \ No newline at end of file diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js index f3cadea1..3b0799cc 100644 --- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js @@ -1,25 +1,36 @@ /** @odoo-module **/ -import { Many2ManyCheckboxesField } from "@web/views/fields/many2many_checkboxes/many2many_checkboxes_field"; -import { registry } from "@web/core/registry"; +import {Many2ManyCheckboxesField} from "@web/views/fields/many2many_checkboxes/many2many_checkboxes_field"; +import {registry} from "@web/core/registry"; export class MyCustomWidget extends Many2ManyCheckboxesField { - // 你可以重写或者添加一些方法和属性 - // 例如,你可以重写setup方法来添加一些事件监听器或者初始化一些变量 - setup() { - super.setup(); // 调用父类的setup方法 - // 你自己的代码 - } - onImageClick(event) { - // 放大图片逻辑 - // 获取图片元素 - const img = event.target; + // 你可以重写或者添加一些方法和属性 + // 例如,你可以重写setup方法来添加一些事件监听器或者初始化一些变量 + setup() { + super.setup(); // 调用父类的setup方法 + // 你自己的代码 + } - // 实现放大图片逻辑 - // 比如使用 CSS 放大 - img.classList.add('zoomed'); - } + onImageClick(event) { + // 放大图片逻辑 + // 获取图片元素 + const img = event.target; + const close = img.nextSibling + + // 实现放大图片逻辑 + // 比如使用 CSS 放大 + img.parentElement.classList.add('zoomed'); + close.classList.add('img_close') + } + + onCloseClick(event) { + const close = event.target; + const img = close.previousSibling + img.parentElement.classList.remove('zoomed') + close.classList.remove('img_close') + } } + MyCustomWidget.template = "sf_plan.MyCustomWidget" // MyCustomWidget.supportedTypes = ['many2many']; diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml index 91eaff59..dedcfb11 100644 --- a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml @@ -2,24 +2,25 @@ -
+
- -
-
+
- + +
×
+
+
From c1be9a90fe1716c08ae2024852ac05f5ce7e9048 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Fri, 8 Sep 2023 17:14:57 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=88=80=E5=85=B7?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=8F=8D=E6=B3=A8=E5=86=8C=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=9B=BE=E7=89=87=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?3d=E6=A8=A1=E5=9E=8B=E4=BB=A3=E7=A0=81=E6=94=BE=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 8 ++++---- sf_manufacturing/models/stock.py | 1 + sf_sale/models/quick_easy_order.py | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index a121ee1f..6f50425f 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 @@ -732,9 +732,9 @@ class ResProductMo(models.Model): # 将attach的datas内容转为glb文件 def transition_glb_file(self, report_path, code): - # shapes = read_step_file(report_path) + 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) + 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') diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index 45b38443..fd014941 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -513,6 +513,7 @@ class ReStockMove(models.Model): 'inner_diameter': item.product_id.cutting_tool_inner_diameter, 'cooling_suit_type_ids': item.product_id.cooling_suit_type_ids, 'er_size_model': item.product_id.cutting_tool_er_size_model, + 'image': '' if not item.product_id.image_1920 else base64.b64encode(item.product_id.image_1920).decode('utf-8'), } try: if item.product_id.industry_code: diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 08d5ae30..eed2be57 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 @@ -87,10 +87,10 @@ class QuickEasyOrder(models.Model): # 将attach的datas内容转为glb文件 def transition_glb_file(self, report_path, model_code): - # shapes = read_step_file(report_path) + shapes = read_step_file(report_path) # output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl') output_file = os.path.join('/tmp', str(model_code) + '.stl') - # write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) + write_stl_file(shapes, output_file, 'binary', 0.03, 0.5) # 转化为glb # output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb') output_glb_file = os.path.join('/tmp', str(model_code) + '.glb') From cf7e6ea33dd2e0fb65497f4c37e245b4956761de Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Mon, 11 Sep 2023 17:21:32 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=88=80=E5=85=B7=E7=BB=84=E8=A3=85=E7=9A=84=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=9B=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=AF=8F=E9=BD=BF=E8=B5=B0=E5=88=80=E9=87=8F?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=96=B0=E5=A2=9E=E5=8A=A0=E5=B7=A5=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E5=AD=97=E6=AE=B5=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=AE=B0=E5=BD=95=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9B=E8=A7=A3=E5=86=B3=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86?= =?UTF-8?q?-=E5=B7=A5=E4=BD=9C=E6=97=A5=E5=8E=86=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=8E=86=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_dlm/views/product_template_view.xml | 4 ++- .../models/tool_other_features.py | 3 +- .../views/tool_other_features_view.xml | 1 + sf_plan_management/models/calendar_base.py | 30 ++++++++++--------- sf_tool_management/views/tool_base_views.xml | 4 +-- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/sf_dlm/views/product_template_view.xml b/sf_dlm/views/product_template_view.xml index f36e1816..19327a82 100644 --- a/sf_dlm/views/product_template_view.xml +++ b/sf_dlm/views/product_template_view.xml @@ -382,7 +382,9 @@ - + diff --git a/sf_manufacturing/models/tool_other_features.py b/sf_manufacturing/models/tool_other_features.py index 198faa09..7e8f04b7 100644 --- a/sf_manufacturing/models/tool_other_features.py +++ b/sf_manufacturing/models/tool_other_features.py @@ -82,6 +82,7 @@ class FeedPerTooth(models.Model): product_template_id = fields.Many2one('product.template', string='产品') cutting_speed = fields.Char('径向切宽 ae(mm)') + machining_method = fields.Selection([('直铣', '直铣'), ('坡铣', '坡铣')], string='加工方式') materials_type_id = fields.Many2one('sf.materials.model', string='材料型号') blade_diameter = fields.Float('刃部直径D1(mm)', readonly=True, compute='_compute_product_template_id') feed_per_tooth = fields.Char('每齿走刀量 (mm/z)') @@ -90,4 +91,4 @@ class FeedPerTooth(models.Model): @api.depends('product_template_id') def _compute_product_template_id(self): if self.product_template_id is not None: - self.blade_diameter = self.product_template_id.integral_blade_diameter + self.blade_diameter = self.product_template_id.cutting_tool_blade_diameter diff --git a/sf_manufacturing/views/tool_other_features_view.xml b/sf_manufacturing/views/tool_other_features_view.xml index 897ff785..3af6d0e8 100644 --- a/sf_manufacturing/views/tool_other_features_view.xml +++ b/sf_manufacturing/views/tool_other_features_view.xml @@ -140,6 +140,7 @@ + diff --git a/sf_plan_management/models/calendar_base.py b/sf_plan_management/models/calendar_base.py index 6ac7772c..95fb6342 100644 --- a/sf_plan_management/models/calendar_base.py +++ b/sf_plan_management/models/calendar_base.py @@ -135,8 +135,10 @@ class WorkLogSetting(models.Model): # 获取本年第一天和最后一天 start_date = datetime.now().replace(month=1, day=1).date() end_date = datetime.now().replace(month=12, day=31).date() + print(self.day_off_ids.mapped('name')) # 休息日列表 rest_days = self.chinese_weekdays_to_english(self.day_off_ids.mapped('name')) + print(rest_days) for single_date in self.daterange(start_date, end_date): is_workday = self.chinese_weekday_to_english(single_date.strftime("%A")) logging.info(f"每天的星期:{is_workday}") @@ -155,13 +157,13 @@ class WorkLogSetting(models.Model): :return: """ weekdays = { - '星期一': 'Monday', - '星期二': 'Tuesday', - '星期三': 'Wednesday', - '星期四': 'Thursday', - '星期五': 'Friday', - '星期六': 'Saturday', - '星期日': 'Sunday' + '星期一': 'Monday', 'Monday': 'Monday', + '星期二': 'Tuesday', 'Tuesday': 'Tuesday', + '星期三': 'Wednesday', 'Wednesday': 'Wednesday', + '星期四': 'Thursday', 'Thursday': 'Thursday', + '星期五': 'Friday', 'Friday': 'Friday', + '星期六': 'Saturday', 'Saturday': 'Saturday', + '星期日': 'Sunday', 'Sunday': 'Sunday', } english_weekdays = [] for chinese_weekday in chinese_weekdays: @@ -177,13 +179,13 @@ class WorkLogSetting(models.Model): :return: """ weekdays = { - '星期一': 'Monday', - '星期二': 'Tuesday', - '星期三': 'Wednesday', - '星期四': 'Thursday', - '星期五': 'Friday', - '星期六': 'Saturday', - '星期日': 'Sunday' + '星期一': 'Monday', 'Monday': 'Monday', + '星期二': 'Tuesday', 'Tuesday': 'Tuesday', + '星期三': 'Wednesday', 'Wednesday': 'Wednesday', + '星期四': 'Thursday', 'Thursday': 'Thursday', + '星期五': 'Friday', 'Friday': 'Friday', + '星期六': 'Saturday', 'Saturday': 'Saturday', + '星期日': 'Sunday', 'Sunday': 'Sunday', } weekday = weekdays.get(chinese_weekday) if weekday: diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml index 35338eac..7192c8f0 100644 --- a/sf_tool_management/views/tool_base_views.xml +++ b/sf_tool_management/views/tool_base_views.xml @@ -1080,7 +1080,7 @@ 功能刀具组装 sf.functional.tool.assembly - + @@ -1133,7 +1133,7 @@ 功能刀具组装 sf.functional.tool.assembly -
+