diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 2127aa99..6f50425f 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -229,7 +229,7 @@ class ResProductMo(models.Model): string='适用刀片型号' # 使用空列表作为默认值 ) cutting_tool_wrench = fields.Float('配对扳手(mm)') - cutting_tool_screw = fields.Float('配备螺丝(mm)') + # cutting_tool_screw = fields.Float('配备螺丝(mm)') cutting_tool_accuracy_level = fields.Char('精度等级') # 刀柄参数 cutting_tool_head_diameter = fields.Float('头部直径') diff --git a/sf_tool_management/models/tool_material_search.py b/sf_tool_management/models/tool_material_search.py index ab9c24f7..5917a097 100644 --- a/sf_tool_management/models/tool_material_search.py +++ b/sf_tool_management/models/tool_material_search.py @@ -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('整体式刀具后角(°)') diff --git a/sf_tool_management/views/tool_material_search.xml b/sf_tool_management/views/tool_material_search.xml index 594073ff..d461efce 100644 --- a/sf_tool_management/views/tool_material_search.xml +++ b/sf_tool_management/views/tool_material_search.xml @@ -194,50 +194,56 @@ - + + - - - + - - - - - - - - - + + + + + + + - + - - + + + + + + + - - - - - - - - + + + + + + +