From 53e307cd55d4f47dcb3afe08c83c4449275a5295 Mon Sep 17 00:00:00 2001 From: "qihao.gong@jikimo.com" Date: Thu, 12 Oct 2023 14:10:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87table?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=20=20=E4=BF=AE=E6=94=B9=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=93=81=E7=89=8C=E6=A0=B9=E6=8D=AE=E5=90=84=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=B1=BB=E5=88=AB=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/scss/custom_style.scss | 12 + sf_base/models/fixture.py | 2 +- sf_base/models/tool_base.py | 2 +- sf_base/models/tool_base_new.py | 2 +- sf_maintenance/models/sf_maintenance.py | 86 +-- sf_maintenance/views/maintenance_views.xml | 706 +++++++++++------- sf_mrs_connect/models/res_config_setting.py | 2 + sf_tool_management/models/base.py | 2 +- .../models/tool_material_search.py | 2 +- 9 files changed, 515 insertions(+), 301 deletions(-) diff --git a/jikimo_frontend/static/src/scss/custom_style.scss b/jikimo_frontend/static/src/scss/custom_style.scss index f90cca94..0d432091 100644 --- a/jikimo_frontend/static/src/scss/custom_style.scss +++ b/jikimo_frontend/static/src/scss/custom_style.scss @@ -304,4 +304,16 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > . .test_model>div .o_field_widget { width: 40% !important; +} + +.o_form_label { + font-weight: 700 !important; +} + +.bigger .o_horizontal_separator { + font-size: 1.5rem; +} + +.o_horizontal_separator { + font-size: 1.5rem; } \ No newline at end of file diff --git a/sf_base/models/fixture.py b/sf_base/models/fixture.py index bc5b19f9..f7cb5fa8 100644 --- a/sf_base/models/fixture.py +++ b/sf_base/models/fixture.py @@ -30,7 +30,7 @@ class FixtureModel(models.Model): fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", ) fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True) multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型") - brand_id = fields.Many2one('sf.machine.brand', string="品牌") + brand_id = fields.Many2one('sf.machine.brand', string="品牌", domain="[('tag_ids.name', 'ilike', '夹具')]") clamping_way = fields.Char(string="装夹方式") port_type = fields.Char(string="接口类型") model_file = fields.Binary(string="3D模型图") diff --git a/sf_base/models/tool_base.py b/sf_base/models/tool_base.py index 2d7d7028..24a39ecc 100644 --- a/sf_base/models/tool_base.py +++ b/sf_base/models/tool_base.py @@ -70,7 +70,7 @@ class IntegralCuttingTool(models.Model): # 整体式刀具类型字段,关联整体式刀具类型对象 integral_model_number = fields.Many2one('sf.integral.cutting.tool.model', '整体式刀具类型') # 增加品牌、总长度(mm)、柄部长度(mm)、刃部长度(mm)、直径(mm)、刃数、前角(°)、后角(°)、主偏角(°)、材料型号、配对螺母(mm)、适用夹头型号、适用范围、图片、创建人、创建时间等字段 - brand = fields.Many2one('sf.machine.brand', '品牌') + brand = fields.Many2one('sf.machine.brand', '品牌', domain="[('tag_ids.name', 'ilike', '刀具')]") total_length = fields.Float('总长度(mm)') shank_length = fields.Float('柄部长度(mm)') blade_length = fields.Float('刃部长度(mm)') diff --git a/sf_base/models/tool_base_new.py b/sf_base/models/tool_base_new.py index fc62074e..c957ab06 100644 --- a/sf_base/models/tool_base_new.py +++ b/sf_base/models/tool_base_new.py @@ -101,7 +101,7 @@ class CuttingToolModel(models.Model): cutting_tool_type = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True) cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='刀具类型', ) - brand_id = fields.Many2one('sf.machine.brand', '品牌') + brand_id = fields.Many2one('sf.machine.brand', '品牌', domain="[('tag_ids.name', 'ilike', '刀具')]") tool_length = fields.Integer('长度(mm)') tool_width = fields.Integer('宽度(mm)') tool_height = fields.Integer('高度(mm)') diff --git a/sf_maintenance/models/sf_maintenance.py b/sf_maintenance/models/sf_maintenance.py index 156ab83f..11ddda79 100644 --- a/sf_maintenance/models/sf_maintenance.py +++ b/sf_maintenance/models/sf_maintenance.py @@ -97,7 +97,7 @@ class SfMaintenanceEquipment(models.Model): control_system_id = fields.Many2one('sf.machine.control_system', string="控制系统") # 多个机床型号对应一个机床 - brand_id = fields.Many2one('sf.machine.brand', string='品牌') + brand_id = fields.Many2one('sf.machine.brand', string='品牌', domain="[('tag_ids.name', 'ilike', equipment_type)]") type_id = fields.Many2one('sf.machine_tool.type', '型号') state = fields.Selection( @@ -154,48 +154,48 @@ class SfMaintenanceEquipment(models.Model): result.append((parameter.id, name)) return result - @api.constrains('rotate_speed') - def _check_rotate_speed(self): - if self.rotate_speed <= 0: - raise UserError("转速不能为0") - - @api.constrains('precision') - def _check_precision(self): - if self.precision <= 0.00: - raise UserError("加工精度不能为0") - - @api.constrains('number_of_knife_library') - def _check_number_of_knife_library(self): - if self.number_of_knife_library <= 0: - raise UserError("刀库数量不能为0") - - @api.constrains('x_axis') - def _check_x_axis(self): - if self.x_axis <= 0: - raise UserError("加工行程里x轴不能为0") - - @api.constrains('y_axis') - def _check_y_axis(self): - if self.y_axis <= 0: - raise UserError("加工行程里y轴不能为0") - - @api.constrains('z_axis') - def _check_z_axis(self): - if self.z_axis <= 0: - raise UserError("加工行程里z轴不能为0") - - @api.constrains('b_axis') - def _check_b_axis(self): - if self.number_of_axles == '四轴': - print(self.number_of_axles) - if self.b_axis <= 0: - raise UserError("加工行程里b轴不能为0") - - @api.constrains('c_axis') - def _check_c_axis(self): - if self.number_of_axles == '五轴': - if self.c_axis <= 0: - raise UserError("加工行程里c轴不能为0") + # @api.constrains('rotate_speed') + # def _check_rotate_speed(self): + # if self.rotate_speed <= 0: + # raise UserError("转速不能为0") + # + # @api.constrains('precision') + # def _check_precision(self): + # if self.equipment_type == '机床' and self.precision <= 0.00: + # raise UserError("加工精度不能为0") + # + # @api.constrains('number_of_knife_library') + # def _check_number_of_knife_library(self): + # if self.equipment_type == '机床' and self.number_of_knife_library <= 0: + # raise UserError("刀库数量不能为0") + # + # @api.constrains('x_axis') + # def _check_x_axis(self): + # if self.equipment_type == '机床' and self.x_axis <= 0: + # raise UserError("加工行程里x轴不能为0") + # + # @api.constrains('y_axis') + # def _check_y_axis(self): + # if self.equipment_type == '机床' and self.y_axis <= 0: + # raise UserError("加工行程里y轴不能为0") + # + # @api.constrains('z_axis') + # def _check_z_axis(self): + # if self.equipment_type == '机床' and self.z_axis <= 0: + # raise UserError("加工行程里z轴不能为0") + # + # @api.constrains('b_axis') + # def _check_b_axis(self): + # if self.equipment_type == '机床' and self.number_of_axles == '四轴': + # print(self.number_of_axles) + # if self.b_axis <= 0: + # raise UserError("加工行程里b轴不能为0") + # + # @api.constrains('c_axis') + # def _check_c_axis(self): + # if self.equipment_type == '机床' and self.number_of_axles == '五轴': + # if self.c_axis <= 0: + # raise UserError("加工行程里c轴不能为0") @api.onchange('type_id') def get_type_info(self): diff --git a/sf_maintenance/views/maintenance_views.xml b/sf_maintenance/views/maintenance_views.xml index 45955147..65c559e9 100644 --- a/sf_maintenance/views/maintenance_views.xml +++ b/sf_maintenance/views/maintenance_views.xml @@ -57,9 +57,8 @@ - - + @@ -68,114 +67,175 @@ - - - - - - - - - - + + + + + - + -