修改设备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

@@ -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):