From 165f961fb421052ba052cb45f1014664a2354b37 Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Tue, 12 Sep 2023 17:36:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E5=88=80=E5=85=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86-=E5=88=80=E5=85=B7=E7=89=A9=E6=96=99=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2-=E6=95=B4=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=99=90=E5=88=B6=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=95=B4=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=9B=BE=E6=96=87=E5=B1=95=E7=A4=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E7=9B=B4=E5=BE=84=E7=B1=BB=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=CF=86=E7=9A=84=E5=89=8D=E7=BC=80=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=EF=BC=9B=E6=B3=A8=E9=87=8A=E4=BA=A7=E5=93=81-?= =?UTF-8?q?=E5=88=80=E5=85=B7=E5=8F=82=E6=95=B0-cutting=5Ftool=5Fscrew?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/product_template.py | 2 +- .../models/tool_material_search.py | 146 +++++++++--------- .../views/tool_material_search.xml | 74 +++++---- 3 files changed, 114 insertions(+), 108 deletions(-) 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 @@ - + + - - - + - - - - - - - - - + + + + + + + - + - - + + + + + + + - - - - - - - - + + + + + + +