diff --git a/sf_base/models/tool_base_new.py b/sf_base/models/tool_base_new.py index 88478c24..fc62074e 100644 --- a/sf_base/models/tool_base_new.py +++ b/sf_base/models/tool_base_new.py @@ -113,29 +113,6 @@ class CuttingToolModel(models.Model): total_length = fields.Float('总长度(mm)') shank_length = fields.Float('柄部长度(mm)') blade_length = fields.Float('刃部长度(mm)') - # 整体式刀具新增字段 - integral_neck_length = fields.Float('整体式刀具颈部长度(mm)', digits=(6, 1)) - integral_shank_diameter = fields.Float('整体式刀具柄部直径(mm)', digits=(6, 1)) - integral_blade_diameter = fields.Float('整体式刀具刃部直径(mm)', digits=(6, 1)) - integral_neck_diameter = fields.Float('整体式刀具颈部直径(mm)', digits=(6, 1)) - integral_blade_tip_diameter = fields.Float('整体式刀具刀尖直径(mm)', digits=(6, 1)) - integral_blade_tip_taper = fields.Float('整体式刀具刀尖锥度(°)', digits=(6, 1)) - integral_blade_helix_angle = fields.Float('整体式刀具刃部螺旋角(°)', digits=(6, 1)) - integral_blade_type = fields.Char('整体式刀具刃部类型') - integral_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '整体式刀具粗/中/精') - integral_hardness = fields.Integer('整体式刀具硬度(HRC)') - integral_run_out_accuracy_max = fields.Float('整体式刀具端跳精度max', digits=(6, 1)) - integral_run_out_accuracy_min = fields.Float('整体式刀具端跳精度min', digits=(6, 1)) - suitable_machining_method_ids = fields.Many2many('sf.suitable.machining.method', - 'rel_suitable_machining_method_cutting_tool', '适合加工方式') - blade_tip_characteristics_ids = fields.Many2many('sf.blade.tip.characteristics', - 'rel_blade_tip_characteristics_cutting_tool', '刀尖特征') - handle_type_ids = fields.Many2many('sf.handle.type', 'rel_handle_type_cutting_tool', '柄部类型') - cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction_cutting_tool', - '走刀方向') - suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant_cutting_tool', - '适合冷却液') - diameter = fields.Float('直径(mm)') blade_number = fields.Integer('刃数') front_angle = fields.Float('前角(°)') diff --git a/sf_base/views/tool_views.xml b/sf_base/views/tool_views.xml index 71dea744..ee5546a8 100644 --- a/sf_base/views/tool_views.xml +++ b/sf_base/views/tool_views.xml @@ -243,10 +243,6 @@ attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/> - - + attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀杆','刀盘'))]}"/> + attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀柄'))]}"/> - - - - - - - - - - + attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/> + attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/> + attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/> + attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/> - + attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄'))]}"/> + - - - - - - - - - - (mm) - - - (mm) - - - - - - - - - - - - - - - - - + attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/> diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index c8c6f8f6..2a91f7f1 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -134,23 +134,23 @@ class ResProductMo(models.Model): if not record.suitable_coolant_ids and self.cutting_tool_type == '整体式刀具': raise ValidationError("适合冷却液不能为空!") - @api.constrains('integral_total_length') - def _check_integral_total_length(self): + @api.constrains('cutting_tool_total_length') + def _check_cutting_tool_total_length(self): if self.cutting_tool_total_length <= 0 and self.cutting_tool_type == '整体式刀具': raise ValidationError("总长度不能为0") - @api.constrains('integral_shank_length') - def _check_integral_shank_length(self): + @api.constrains('cutting_tool_shank_length') + def _check_cutting_tool_shank_length(self): if self.cutting_tool_shank_length <= 0 and self.cutting_tool_type == '整体式刀具': raise ValidationError("柄部长度不能为0") - @api.constrains('integral_blade_length') - def _check_integral_blade_length(self): + @api.constrains('cutting_tool_blade_length') + def _check_cutting_tool_blade_length(self): if self.cutting_tool_blade_length <= 0 and self.cutting_tool_type == '整体式刀具': raise ValidationError("刃部长度不能为0") - @api.constrains('integral_blade_number') - def _check_integral_blade_number(self): + @api.constrains('cutting_tool_blade_number') + def _check_cutting_tool_blade_number(self): if self.cutting_tool_blade_number <= 0 and self.cutting_tool_type == '整体式刀具': raise ValidationError("刃数不能为0")