1.修改刀具标准库刀片形状,柄部类型,压紧方式,刀尖特征,字段类型及对应控件显示
2.修改产品页面:刀片形状,柄部类型,压紧方式,刀尖特征,字段类型及对应控件显示
This commit is contained in:
@@ -87,7 +87,7 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_run_out_accuracy_max = fields.Float('端跳精度max', digits=(6, 1))
|
||||
cutting_tool_run_out_accuracy_min = fields.Float('端跳精度min', digits=(6, 1))
|
||||
cutting_tool_blade_tip_working_size = fields.Char('刀尖处理尺寸(R半径mm/倒角)', size=20)
|
||||
fit_blade_shape_id = fields.Many2many('maintenance.equipment.image', 'rel_fit_blade_shape_product_template',
|
||||
fit_blade_shape_id = fields.Many2one('maintenance.equipment.image',
|
||||
'适配刀片形状', domain=[('type', '=', '刀片形状')])
|
||||
suitable_machining_method_ids = fields.Many2many('maintenance.equipment.image',
|
||||
'rel_machining_product_template', '适合加工方式',
|
||||
@@ -95,8 +95,7 @@ class ResProductMo(models.Model):
|
||||
blade_tip_characteristics_id = fields.Many2many('maintenance.equipment.image',
|
||||
'rel_blade_tip_product_template', '刀尖特征',
|
||||
domain=[('type', '=', '刀尖特征')])
|
||||
handle_type_ids = fields.Many2many('maintenance.equipment.image', 'rel_handle_product_template', '柄部类型',
|
||||
domain=[('type', '=', '柄部类型')])
|
||||
handle_type_id = fields.Many2one('maintenance.equipment.image', '柄部类型',domain=[('type', '=', '柄部类型')])
|
||||
cutting_direction_ids = fields.Many2many('maintenance.equipment.image', 'rel_cutting_product_template',
|
||||
'走刀方向', domain=[('type', '=', '走刀方向')])
|
||||
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
|
||||
@@ -141,7 +140,7 @@ class ResProductMo(models.Model):
|
||||
item.fit_blade_shape_id = False
|
||||
item.suitable_machining_method_ids = False
|
||||
item.blade_tip_characteristics_id = False
|
||||
item.handle_type_ids = False
|
||||
item.handle_type_id = False
|
||||
item.cutting_direction_ids = False
|
||||
item.suitable_coolant_ids = False
|
||||
item.compaction_way_ids = False
|
||||
@@ -292,9 +291,7 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_model_id.blade_tip_characteristics_id \
|
||||
else [(6, 0, self.cutting_tool_model_id.blade_tip_characteristics_id.ids)]
|
||||
|
||||
self.handle_type_ids = [(6, 0,
|
||||
[])] if not self.cutting_tool_model_id.handle_type_ids else [
|
||||
(6, 0, self.cutting_tool_model_id.handle_type_ids.ids)]
|
||||
self.handle_type_id = self.cutting_tool_model_id.handle_type_id
|
||||
|
||||
self.cutting_direction_ids = [(6, 0,
|
||||
[])] if not self.cutting_tool_model_id.cutting_direction_ids else [
|
||||
@@ -346,7 +343,7 @@ class ResProductMo(models.Model):
|
||||
self.feed_per_tooth_ids = False
|
||||
|
||||
@api.constrains('fit_blade_shape_id', 'suitable_machining_method_ids', 'blade_tip_characteristics_id',
|
||||
'handle_type_ids', 'cutting_direction_ids', 'suitable_coolant_ids', 'compaction_way_ids')
|
||||
'handle_type_id', 'cutting_direction_ids', 'suitable_coolant_ids', 'compaction_way_ids')
|
||||
def _check_cutting_tool_ability(self):
|
||||
if self.cutting_tool_type in ['整体式刀具', '刀片', '刀杆', '刀盘']:
|
||||
if self.cutting_tool_type in ['刀片', '刀杆', '刀盘']:
|
||||
@@ -359,7 +356,7 @@ class ResProductMo(models.Model):
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却液")
|
||||
elif self.cutting_tool_type == '整体式刀具':
|
||||
if not self.handle_type_ids:
|
||||
if not self.handle_type_id:
|
||||
raise ValidationError("请选择柄部类型")
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却液")
|
||||
|
||||
Reference in New Issue
Block a user