注释刀具管理-刀具物料查询-整体式刀具参数限制,调整整体式刀具参数位置,添加能力参数图文展示功能,直径类参数增加φ的前缀单位;注释产品-刀具参数-cutting_tool_screw。
This commit is contained in:
@@ -105,79 +105,79 @@ class SfToolMaterialSearch(models.Model):
|
||||
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:
|
||||
if len(record.suitable_machining_method_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合加工方式不能为空!")
|
||||
|
||||
@api.constrains('blade_tip_characteristics_ids')
|
||||
def _check_blade_tip_characteristics_ids(self):
|
||||
for record in self:
|
||||
if len(record.blade_tip_characteristics_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征不能为空!")
|
||||
if len(record.blade_tip_characteristics_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征只能单选!")
|
||||
|
||||
@api.constrains('handle_type_ids')
|
||||
def _check_handle_type_ids(self):
|
||||
for record in self:
|
||||
if len(record.handle_type_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型不能为空!")
|
||||
if len(record.handle_type_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型只能单选!")
|
||||
|
||||
@api.constrains('cutting_direction_ids')
|
||||
def _check_cutting_direction_ids(self):
|
||||
for record in self:
|
||||
if len(record.cutting_direction_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("走刀方向不能为空!")
|
||||
|
||||
@api.constrains('suitable_coolant_ids')
|
||||
def _check_suitable_coolant_ids(self):
|
||||
for record in self:
|
||||
if not record.suitable_coolant_ids and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合冷却液不能为空!")
|
||||
|
||||
@api.constrains('integral_total_length')
|
||||
def _check_integral_total_length(self):
|
||||
if self.integral_total_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("总长度不能为0")
|
||||
|
||||
@api.constrains('integral_shank_length')
|
||||
def _check_integral_shank_length(self):
|
||||
if self.integral_shank_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部长度不能为0")
|
||||
|
||||
@api.constrains('integral_blade_length')
|
||||
def _check_integral_blade_length(self):
|
||||
if self.integral_blade_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃部长度不能为0")
|
||||
|
||||
@api.constrains('integral_blade_number')
|
||||
def _check_integral_blade_number(self):
|
||||
if self.integral_blade_number <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃数不能为0")
|
||||
|
||||
@api.constrains('integral_shank_diameter')
|
||||
def _check_integral_shank_diameter(self):
|
||||
if self.integral_shank_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部直径不能为0")
|
||||
|
||||
@api.constrains('integral_blade_diameter')
|
||||
def _check_integral_blade_diameter(self):
|
||||
if self.integral_blade_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃部直径不能为0")
|
||||
|
||||
@api.constrains('integral_run_out_accuracy_min')
|
||||
def _check_integral_blade_diameter(self):
|
||||
if self.integral_run_out_accuracy_min <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("端跳精度最小(min)不能为0")
|
||||
|
||||
@api.constrains('integral_run_out_accuracy_max')
|
||||
def _check_integral_run_out_accuracy_max(self):
|
||||
if self.integral_run_out_accuracy_max <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("端跳精度最大(max)不能为0")
|
||||
# @api.constrains('suitable_machining_method_ids')
|
||||
# def _check_suitable_machining_method_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.suitable_machining_method_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("适合加工方式不能为空!")
|
||||
#
|
||||
# @api.constrains('blade_tip_characteristics_ids')
|
||||
# def _check_blade_tip_characteristics_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.blade_tip_characteristics_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刀尖特征不能为空!")
|
||||
# if len(record.blade_tip_characteristics_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刀尖特征只能单选!")
|
||||
#
|
||||
# @api.constrains('handle_type_ids')
|
||||
# def _check_handle_type_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.handle_type_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部类型不能为空!")
|
||||
# if len(record.handle_type_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部类型只能单选!")
|
||||
#
|
||||
# @api.constrains('cutting_direction_ids')
|
||||
# def _check_cutting_direction_ids(self):
|
||||
# for record in self:
|
||||
# if len(record.cutting_direction_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("走刀方向不能为空!")
|
||||
#
|
||||
# @api.constrains('suitable_coolant_ids')
|
||||
# def _check_suitable_coolant_ids(self):
|
||||
# for record in self:
|
||||
# if not record.suitable_coolant_ids and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("适合冷却液不能为空!")
|
||||
#
|
||||
# @api.constrains('integral_total_length')
|
||||
# def _check_integral_total_length(self):
|
||||
# if self.integral_total_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("总长度不能为0")
|
||||
#
|
||||
# @api.constrains('integral_shank_length')
|
||||
# def _check_integral_shank_length(self):
|
||||
# if self.integral_shank_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部长度不能为0")
|
||||
#
|
||||
# @api.constrains('integral_blade_length')
|
||||
# def _check_integral_blade_length(self):
|
||||
# if self.integral_blade_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刃部长度不能为0")
|
||||
#
|
||||
# @api.constrains('integral_blade_number')
|
||||
# def _check_integral_blade_number(self):
|
||||
# if self.integral_blade_number <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刃数不能为0")
|
||||
#
|
||||
# @api.constrains('integral_shank_diameter')
|
||||
# def _check_integral_shank_diameter(self):
|
||||
# if self.integral_shank_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("柄部直径不能为0")
|
||||
#
|
||||
# @api.constrains('integral_blade_diameter')
|
||||
# def _check_integral_blade_diameter(self):
|
||||
# if self.integral_blade_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("刃部直径不能为0")
|
||||
#
|
||||
# @api.constrains('integral_run_out_accuracy_min')
|
||||
# def _check_integral_blade_diameter(self):
|
||||
# if self.integral_run_out_accuracy_min <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("端跳精度最小(min)不能为0")
|
||||
#
|
||||
# @api.constrains('integral_run_out_accuracy_max')
|
||||
# def _check_integral_run_out_accuracy_max(self):
|
||||
# if self.integral_run_out_accuracy_max <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
# raise ValidationError("端跳精度最大(max)不能为0")
|
||||
|
||||
# integral_front_angle = fields.Float('整体式刀具前角(°)')
|
||||
# integral_rear_angle = fields.Float('整体式刀具后角(°)')
|
||||
|
||||
Reference in New Issue
Block a user