修改设备table的样式 修改关联品牌根据各不同类别展示

This commit is contained in:
qihao.gong@jikimo.com
2023-10-12 14:10:29 +08:00
parent 6724d0e0c1
commit 53e307cd55
9 changed files with 515 additions and 301 deletions

View File

@@ -305,3 +305,15 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .
.test_model>div .o_field_widget { .test_model>div .o_field_widget {
width: 40% !important; 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;
}

View File

@@ -30,7 +30,7 @@ class FixtureModel(models.Model):
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", ) fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", )
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True) fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True)
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型") 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="装夹方式") clamping_way = fields.Char(string="装夹方式")
port_type = fields.Char(string="接口类型") port_type = fields.Char(string="接口类型")
model_file = fields.Binary(string="3D模型图") model_file = fields.Binary(string="3D模型图")

View File

@@ -70,7 +70,7 @@ class IntegralCuttingTool(models.Model):
# 整体式刀具类型字段,关联整体式刀具类型对象 # 整体式刀具类型字段,关联整体式刀具类型对象
integral_model_number = fields.Many2one('sf.integral.cutting.tool.model', '整体式刀具类型') integral_model_number = fields.Many2one('sf.integral.cutting.tool.model', '整体式刀具类型')
# 增加品牌、总长度(mm)、柄部长度(mm)、刃部长度(mm)、直径(mm)、刃数、前角(°)、后角(°)、主偏角(°)、材料型号、配对螺母(mm)、适用夹头型号、适用范围、图片、创建人、创建时间等字段 # 增加品牌、总长度(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)') total_length = fields.Float('总长度(mm)')
shank_length = fields.Float('柄部长度(mm)') shank_length = fields.Float('柄部长度(mm)')
blade_length = fields.Float('刃部长度(mm)') blade_length = fields.Float('刃部长度(mm)')

View File

@@ -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 = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True)
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='刀具类型', 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_length = fields.Integer('长度(mm)')
tool_width = fields.Integer('宽度(mm)') tool_width = fields.Integer('宽度(mm)')
tool_height = fields.Integer('高度(mm)') tool_height = fields.Integer('高度(mm)')

View File

@@ -97,7 +97,7 @@ class SfMaintenanceEquipment(models.Model):
control_system_id = fields.Many2one('sf.machine.control_system', control_system_id = fields.Many2one('sf.machine.control_system',
string="控制系统") 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', '型号') type_id = fields.Many2one('sf.machine_tool.type', '型号')
state = fields.Selection( state = fields.Selection(
@@ -154,48 +154,48 @@ class SfMaintenanceEquipment(models.Model):
result.append((parameter.id, name)) result.append((parameter.id, name))
return result return result
@api.constrains('rotate_speed') # @api.constrains('rotate_speed')
def _check_rotate_speed(self): # def _check_rotate_speed(self):
if self.rotate_speed <= 0: # if self.rotate_speed <= 0:
raise UserError("转速不能为0") # raise UserError("转速不能为0")
#
@api.constrains('precision') # @api.constrains('precision')
def _check_precision(self): # def _check_precision(self):
if self.precision <= 0.00: # if self.equipment_type == '机床' and self.precision <= 0.00:
raise UserError("加工精度不能为0") # raise UserError("加工精度不能为0")
#
@api.constrains('number_of_knife_library') # @api.constrains('number_of_knife_library')
def _check_number_of_knife_library(self): # def _check_number_of_knife_library(self):
if self.number_of_knife_library <= 0: # if self.equipment_type == '机床' and self.number_of_knife_library <= 0:
raise UserError("刀库数量不能为0") # raise UserError("刀库数量不能为0")
#
@api.constrains('x_axis') # @api.constrains('x_axis')
def _check_x_axis(self): # def _check_x_axis(self):
if self.x_axis <= 0: # if self.equipment_type == '机床' and self.x_axis <= 0:
raise UserError("加工行程里x轴不能为0") # raise UserError("加工行程里x轴不能为0")
#
@api.constrains('y_axis') # @api.constrains('y_axis')
def _check_y_axis(self): # def _check_y_axis(self):
if self.y_axis <= 0: # if self.equipment_type == '机床' and self.y_axis <= 0:
raise UserError("加工行程里y轴不能为0") # raise UserError("加工行程里y轴不能为0")
#
@api.constrains('z_axis') # @api.constrains('z_axis')
def _check_z_axis(self): # def _check_z_axis(self):
if self.z_axis <= 0: # if self.equipment_type == '机床' and self.z_axis <= 0:
raise UserError("加工行程里z轴不能为0") # raise UserError("加工行程里z轴不能为0")
#
@api.constrains('b_axis') # @api.constrains('b_axis')
def _check_b_axis(self): # def _check_b_axis(self):
if self.number_of_axles == '四轴': # if self.equipment_type == '机床' and self.number_of_axles == '四轴':
print(self.number_of_axles) # print(self.number_of_axles)
if self.b_axis <= 0: # if self.b_axis <= 0:
raise UserError("加工行程里b轴不能为0") # raise UserError("加工行程里b轴不能为0")
#
@api.constrains('c_axis') # @api.constrains('c_axis')
def _check_c_axis(self): # def _check_c_axis(self):
if self.number_of_axles == '五轴': # if self.equipment_type == '机床' and self.number_of_axles == '五轴':
if self.c_axis <= 0: # if self.c_axis <= 0:
raise UserError("加工行程里c轴不能为0") # raise UserError("加工行程里c轴不能为0")
@api.onchange('type_id') @api.onchange('type_id')
def get_type_info(self): def get_type_info(self):

File diff suppressed because it is too large Load Diff

View File

@@ -66,6 +66,8 @@ class ResConfigSettings(models.TransientModel):
self.env['sf.machine_tool.type'].sync_all_machine_tool_type() self.env['sf.machine_tool.type'].sync_all_machine_tool_type()
_logger.info("同步资源库机床型号完成") _logger.info("同步资源库机床型号完成")
self.env['maintenance.equipment.image'].sync_all_maintenance_equipment_image()
_logger.info("同步能力特征库")
except Exception as e: except Exception as e:
_logger.info("捕获错误信息:%s" % e) _logger.info("捕获错误信息:%s" % e)
raise ValidationError("数据错误导致同步失败,请联系管理员") raise ValidationError("数据错误导致同步失败,请联系管理员")

View File

@@ -756,7 +756,7 @@ class FunctionalToolAssembly(models.Model):
domain=[('cutting_tool_material_id', '=', '整体式刀具')]) domain=[('cutting_tool_material_id', '=', '整体式刀具')])
integral_code = fields.Char('整体式刀具序列号', readonly=True) integral_code = fields.Char('整体式刀具序列号', readonly=True)
integral_name = fields.Char('整体式刀具名称', readonly=True) integral_name = fields.Char('整体式刀具名称', readonly=True)
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True) sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True, domain="[('tag_ids.name', 'ilike', '刀具')]")
# 刀片型号 # 刀片型号
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True, cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
domain=[('cutting_tool_material_id', '=', '刀片')]) domain=[('cutting_tool_material_id', '=', '刀片')])

View File

@@ -19,7 +19,7 @@ class SfToolMaterialSearch(models.Model):
mrs_cutting_tool_material_name = fields.Char(related='mrs_cutting_tool_material_id.name', string='刀具物料名称', mrs_cutting_tool_material_name = fields.Char(related='mrs_cutting_tool_material_id.name', string='刀具物料名称',
store=True) store=True)
cutting_tool_type = fields.Char(related='mrs_cutting_tool_material_id.name', string='刀具物料类型', store=True) cutting_tool_type = fields.Char(related='mrs_cutting_tool_material_id.name', string='刀具物料类型', store=True)
mrs_machine_brand_id = fields.Many2one('sf.machine.brand', '品牌', required=True) mrs_machine_brand_id = fields.Many2one('sf.machine.brand', '品牌', required=True, domain="[('tag_ids.name', 'ilike', '刀具')]")
# 关联刀具型号 # 关联刀具型号
# mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', '刀具型号') # mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', '刀具型号')