From 8e61d5f87c4ce692200ba95ffd2577e092836685 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Thu, 28 Dec 2023 10:50:44 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/security/group_security.xml | 2 +- sf_warehouse/security/ir.model.access.csv | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sf_base/security/group_security.xml b/sf_base/security/group_security.xml index dd78c2c0..478d41b9 100644 --- a/sf_base/security/group_security.xml +++ b/sf_base/security/group_security.xml @@ -71,7 +71,7 @@ 计划总监 - + diff --git a/sf_warehouse/security/ir.model.access.csv b/sf_warehouse/security/ir.model.access.csv index 2367fbd7..87ddef13 100644 --- a/sf_warehouse/security/ir.model.access.csv +++ b/sf_warehouse/security/ir.model.access.csv @@ -96,7 +96,7 @@ access_stock_replenish_option,stock.replenishment.option,stock.model_stock_reple access_mrp_production,mrp.production,mrp.model_mrp_production,sf_warehouse.group_sf_stock_user,1,1,1,0 access_sf_shelf_location,sf.shelf.location,model_sf_shelf_location,sf_base.group_plan_dispatch,1,0,0,0 -access_stock_move,stock.move,stock.model_stock_move,sf_base.group_plan_dispatch,1,0,0,0 +access_stock_move,stock.move,stock.model_stock_move,sf_base.group_plan_dispatch,1,1,1,0 access_stock_scrap_user,stock.scrap.user,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0 access_stock_scrap_manager,stock.scrap.manager,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0 access_stock_picking,stock.picking,stock.model_stock_picking,sf_base.group_plan_dispatch,1,0,0,0 @@ -104,8 +104,10 @@ access_stock_lot,stock.lot,stock.model_stock_lot,sf_base.group_plan_dispatch,1,1 access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,sf_base.group_plan_dispatch,1,0,0,0 access_stock_quant,stock.quant,stock.model_stock_quant,sf_base.group_plan_dispatch,1,0,0,0 -access_product_product,product.product,product.model_product_product,sf_base.group_plan_dispatch,1,1,1,0 -access_product_template,product.template,product.model_product_template,sf_base.group_plan_dispatch,1,1,1,0 +access_product_product,product.product,product.model_product_product,sf_base.group_plan_dispatch,1,0,0,0 +access_product_template,product.template,product.model_product_template,sf_base.group_plan_dispatch,1,0,0,0 +access_product_product,product.product,product.model_product_product,sf_base.group_plan_director,1,1,1,0 +access_product_template,product.template,product.model_product_template,sf_base.group_plan_director,1,1,1,0 access_stock_inventory_conflict,stock.inventory.conflict,stock.model_stock_inventory_conflict,sf_base.group_plan_dispatch,1,0,0,0 access_stock_inventory_warning,stock.inventory.warning,stock.model_stock_inventory_warning,sf_base.group_plan_dispatch,1,0,0,0 From 98847a2c42c5dcc95ccfe501f9c30182dcc290c4 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Thu, 28 Dec 2023 17:38:56 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=8E=A7=E5=88=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_maintenance/models/sf_maintenance.py | 2 +- sf_maintenance/views/maintenance_views.xml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py index b09fb373..6aac4f91 100644 --- a/sf_maintenance/models/sf_maintenance.py +++ b/sf_maintenance/models/sf_maintenance.py @@ -139,7 +139,7 @@ class SfMaintenanceEquipment(models.Model): record.equipment_type = record.category_id.equipment_type code = fields.Char('行业编码') - name = fields.Char('机台号') + name = fields.Char('机台号', required=False) knife_type = fields.Selection( [("BT40", "BT40"), ("BT30", "BT30"), ("BT50", "BT50")], default="", string="刀把类型") diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml index ccf333ba..135cf950 100644 --- a/sf_maintenance/views/maintenance_views.xml +++ b/sf_maintenance/views/maintenance_views.xml @@ -62,15 +62,15 @@ attrs="{'invisible': [('equipment_type', '!=', '机床')]}"> - + diff --git a/sf_mrs_connect/controllers/controllers.py b/sf_mrs_connect/controllers/controllers.py index d728f569..bb6fd591 100644 --- a/sf_mrs_connect/controllers/controllers.py +++ b/sf_mrs_connect/controllers/controllers.py @@ -26,7 +26,8 @@ class Sf_Mrs_Connect(http.Controller): cnc_production = request.env['mrp.production'].with_user( request.env.ref("base.user_admin")).search([('name', '=', ret['production_order_no'])]) if cnc_production: - cnc_production.glb_file = base64.b64encode(ret['glb_file']) + if ret['glb_file']: + cnc_production.glb_file = base64.b64encode(ret['glb_file']) # 拉取所有加工面的程序文件 # i = 1 for r in ret['processing_panel']: @@ -35,7 +36,7 @@ class Sf_Mrs_Connect(http.Controller): ret['folder_name'], r) if not download_state: res['status'] = -2 - res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_production.production_id.name) + res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_production.name) return json.JSONEncoder().encode(res) request.env['sf.cnc.processing'].with_user( request.env.ref("base.user_admin")).cnc_processing_create(cnc_production, ret) diff --git a/sf_sale/models/auto_quatotion_common.py b/sf_sale/models/auto_quatotion_common.py index 1b29c6d2..09ea3f0f 100644 --- a/sf_sale/models/auto_quatotion_common.py +++ b/sf_sale/models/auto_quatotion_common.py @@ -2,7 +2,7 @@ import logging from odoo.modules import get_resource_path from odoo import fields, models, api -#from quatotion import readSql, feature_recognize, auto_quatotion +from quatotion import readSql, feature_recognize, auto_quatotion __author__ = 'jinling.yang' _logger = logging.getLogger(__name__) diff --git a/sf_sale/models/quick_easy_order.py b/sf_sale/models/quick_easy_order.py index 5ec1fd52..1e5f274c 100644 --- a/sf_sale/models/quick_easy_order.py +++ b/sf_sale/models/quick_easy_order.py @@ -5,8 +5,8 @@ import os import json from datetime import datetime import requests -#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 import models, fields, api from odoo.modules import get_resource_path from odoo.exceptions import ValidationError, UserError From e29883d0de94b4129882d70a7ee50437a1855be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E7=84=B1?= Date: Fri, 5 Jan 2024 14:10:43 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=EF=BC=8C=E7=AD=89=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/scss/custom_style.scss | 29 +++++++++++---- .../static/src/scss/rowno_in_tree.scss | 2 +- sf_dlm_management/static/js/changeCss.js | 35 +++++++++++++++++++ .../product_template_management_view.xml | 4 ++- sf_sale/__manifest__.py | 5 +++ sf_sale/static/js/setTableWidth.js | 28 +++++++++++++++ sf_tool_management/__manifest__.py | 2 ++ sf_tool_management/static/src/change.scss | 10 ++++++ 8 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 sf_dlm_management/static/js/changeCss.js create mode 100644 sf_sale/static/js/setTableWidth.js diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss index 5d660025..eddf019b 100644 --- a/jikimo_frontend/static/src/scss/custom_style.scss +++ b/jikimo_frontend/static/src/scss/custom_style.scss @@ -132,11 +132,11 @@ td.o_required_modifier { //font-weight: bold; } -.text-truncate { - overflow: unset !important; - text-overflow: unset !important; - white-space: nowrap!important; -} +//.text-truncate { +// overflow: unset !important; +// text-overflow: unset !important; +// white-space: nowrap!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) { white-space: nowrap !important; @@ -383,7 +383,9 @@ div:has(.o_required_modifier) > label::before { } } } - +.oe_kanban_details li.o_text_overflow { + display: block; +} .o_stock_kanban .o_kanban_card_content { .row { align-items: center; @@ -411,4 +413,19 @@ div:has(.o_required_modifier) > label::before { .o_inner_group.processingMethod { grid-template-columns: auto; } +} + +// 设置所有表格序号列padding为0 +.o_form_view .o_notebook > .tab-content > .tab-pane > :first-child:not(.o_group) .o_field_x2many.o_field_x2many_list tr > :first-child, .o_form_view .o_notebook > .tab-content > .tab-pane > :first-child.o_invisible_modifier + .o_field_widget .o_field_x2many.o_field_x2many_list tr > :first-child { + padding: 0; + text-align: center; +} + +// 设置剩余number类型数据表格列 left +.o_list_renderer .o_list_table thead .o_list_number_th { + text-align:left; +} + +.o_list_renderer .flex-row-reverse { + flex-direction: unset!important; } \ No newline at end of file diff --git a/jikimo_frontend/static/src/scss/rowno_in_tree.scss b/jikimo_frontend/static/src/scss/rowno_in_tree.scss index c244ad7d..5f8a2648 100644 --- a/jikimo_frontend/static/src/scss/rowno_in_tree.scss +++ b/jikimo_frontend/static/src/scss/rowno_in_tree.scss @@ -1,4 +1,4 @@ .row_no { - width: 3.2% !important; + width: 35px !important; vertical-align: middle; } diff --git a/sf_dlm_management/static/js/changeCss.js b/sf_dlm_management/static/js/changeCss.js new file mode 100644 index 00000000..9510a207 --- /dev/null +++ b/sf_dlm_management/static/js/changeCss.js @@ -0,0 +1,35 @@ +// 因为表格可以拖动设置宽度,所以需要用js设置初始宽度 +function setBasicParamTableWidth() { + + + const basicParamDom = $('.fixTableCss') + let dom = [] + try { + dom = basicParamDom.find('table').find('thead').children().children() + + } catch { + dom = [] + } + if (!dom) return + dom.each(function () { + if ($(this).hasClass('row_no') >= 0) { // 序号列 + // 不设置 通过css设置 + } + const text = $(this).text() + $(this).find('span').removeClass('text-truncate') + if (text.length > 5) { + $(this).width('150px') + } else if (text.length == 5) { + $(this).width('100px') + } else if (text.length == 4) { + $(this).width('80px') + } else if (text.length == 3) { + $(this).width('65px') + } else if (text.length == 2) { + $(this).width('50px') + } + + }) +} + +setTimeout(setBasicParamTableWidth, 500) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 737d56db..b1bd8751 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -444,7 +444,7 @@ + attrs="{'readonly': [('categ_type', '=', '刀具')]}" class="fixTableCss"> @@ -463,6 +463,8 @@ + + diff --git a/sf_sale/__manifest__.py b/sf_sale/__manifest__.py index ba6a99db..6d340058 100644 --- a/sf_sale/__manifest__.py +++ b/sf_sale/__manifest__.py @@ -22,6 +22,11 @@ 'views/purchase_order_view.xml', 'views/quick_easy_order_view.xml' ], + 'assets': { + 'web.assets_backend': [ + 'sf_sale/static/js/setTableWidth.js', + ] + }, 'demo': [ ], 'qweb': [ diff --git a/sf_sale/static/js/setTableWidth.js b/sf_sale/static/js/setTableWidth.js new file mode 100644 index 00000000..7cae3950 --- /dev/null +++ b/sf_sale/static/js/setTableWidth.js @@ -0,0 +1,28 @@ +function setTableWidth() { + let timer = null + const dom = $('.o_list_renderer ') + if(!dom.length) { + timer = setTimeout(setTableWidth, 500) + return + } + const widthTest = '' + $('body').append(widthTest) + clearTimeout(timer) + const tbody_tr = dom.find('tbody').children('tr') + dom.find('thead').children('tr').children().each(function () { + $('#widthTest').text($(this).text()) + const width = $('#widthTest').width() + const i = $(this).index() + console.log(111) + tbody_tr.each(function () { + if($(this).children().length > 2) { + $(this).children().eq(i).css('min-width', width + 'px') + } + }) + }) +} + +$(function () { + setTableWidth() +}) + diff --git a/sf_tool_management/__manifest__.py b/sf_tool_management/__manifest__.py index e334c32a..c56f9463 100644 --- a/sf_tool_management/__manifest__.py +++ b/sf_tool_management/__manifest__.py @@ -27,6 +27,8 @@ 'web.assets_qweb': [ ], 'web.assets_backend': [ + 'sf_tool_management/static/src/change.scss' + ] }, diff --git a/sf_tool_management/static/src/change.scss b/sf_tool_management/static/src/change.scss index 40fdcc8e..a4e64f97 100644 --- a/sf_tool_management/static/src/change.scss +++ b/sf_tool_management/static/src/change.scss @@ -8,4 +8,14 @@ .modal-content .o_list_button { +} + +.o_form_view .o_field_widget .o_list_renderer { + width: calc(100% - 64px) !important; + margin:0 auto; + overflow: auto; +} + +.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector).o_list_number { + text-align: left; } \ No newline at end of file From 831a91c9258227bc7ec75d00f749c0b68cf9c3b8 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Fri, 5 Jan 2024 14:42:38 +0800 Subject: [PATCH 18/18] =?UTF-8?q?1=E3=80=81=E4=BA=A7=E5=93=81=E6=96=B0?= =?UTF-8?q?=E6=B7=BB=E4=B8=83=E7=A7=8D=E5=A4=B9=E5=85=B7=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=AD=97=E6=AE=B5=E5=AE=8C=E6=88=90=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=B1=95=E7=A4=BA=EF=BC=9B2=E3=80=81=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E9=80=89=E5=8F=96=E5=A4=B9=E5=85=B7=E5=9E=8B=E5=8F=B7?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=E5=90=8E=E8=87=AA=E5=8A=A8=E5=B8=A6=E5=85=A5?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=E6=95=B0=E6=8D=AE=E5=88=B0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=A4=B9=E5=85=B7=E7=89=A9=E6=96=99=E5=8F=82=E6=95=B0=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product_template_management_view.xml | 99 +++++++++++++++---- sf_manufacturing/models/product_template.py | 44 +++++++++ 2 files changed, 126 insertions(+), 17 deletions(-) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index a072fc28..cb26cfc8 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -498,37 +498,102 @@ - - - + + + + - + - + diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index d5d5a9ed..333da9aa 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -877,6 +877,50 @@ class ResProductFixture(models.Model): mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2)) centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2)) + @api.onchange('specification_fixture_id') + def _onchange_specification_fixture_id(self): + if self.specification_fixture_id: + self.length = self.specification_fixture_id.length + self.width = self.specification_fixture_id.width + self.height = self.specification_fixture_id.height + self.weight = self.specification_fixture_id.weight + self.diameter = self.specification_fixture_id.diameter + self.orientation_dish_diameter = self.specification_fixture_id.orientation_dish_diameter + self.clamping_diameter = self.specification_fixture_id.clamping_diameter + self.clamping_num = self.specification_fixture_id.clamping_num + self.chucking_power_max = self.specification_fixture_id.chucking_power_max + self.repeated_positioning_accuracy = self.specification_fixture_id.repeated_positioning_accuracy + self.boolean_transposing_hole = self.specification_fixture_id.boolean_transposing_hole + self.unlocking_method = self.specification_fixture_id.unlocking_method + self.boolean_chip_blowing_function = self.specification_fixture_id.boolean_chip_blowing_function + self.carrying_capacity_max = self.specification_fixture_id.carrying_capacity_max + self.rigidity = self.specification_fixture_id.rigidity + self.materials_model_id = self.specification_fixture_id.materials_model_id + self.machine_tool_type_id = self.specification_fixture_id.machine_tool_type_id + self.connector_diameter = self.specification_fixture_id.connector_diameter + self.way_to_install = self.specification_fixture_id.way_to_install + self.type_of_drive = self.specification_fixture_id.type_of_drive + self.gripper_length_min = self.specification_fixture_id.gripper_length_min + self.gripper_width_min = self.specification_fixture_id.gripper_width_min + self.gripper_height_min = self.specification_fixture_id.gripper_height_min + self.gripper_diameter_min = self.specification_fixture_id.gripper_diameter_min + self.gripper_length_max = self.specification_fixture_id.gripper_length_max + self.gripper_width_max = self.specification_fixture_id.gripper_width_max + self.gripper_height_max = self.specification_fixture_id.gripper_height_max + self.gripper_diameter_max = self.specification_fixture_id.gripper_diameter_max + self.rated_air_pressure = self.specification_fixture_id.rated_air_pressure + self.interface_materials_model_id = self.specification_fixture_id.interface_materials_model_id + self.transverse_groove = self.specification_fixture_id.transverse_groove + self.longitudinal_fitting_groove = self.specification_fixture_id.longitudinal_fitting_groove + self.height_tolerance_value = self.specification_fixture_id.height_tolerance_value + self.rated_adsorption_force = self.specification_fixture_id.rated_adsorption_force + self.magnetic_field_height = self.specification_fixture_id.magnetic_field_height + self.magnetic_pole_plate_grinding_allowance = self.specification_fixture_id.magnetic_pole_plate_grinding_allowance + self.screw_size = self.specification_fixture_id.screw_size + self.via_hole_diameter = self.specification_fixture_id.via_hole_diameter + self.mounting_hole_depth = self.specification_fixture_id.mounting_hole_depth + self.centering_diameter = self.specification_fixture_id.centering_diameter + class SfMaintenanceEquipmentAndProductTemplate(models.Model): _inherit = 'maintenance.equipment'