Accept Merge Request #379: (feature/刀具优化 -> develop)
Merge Request: 刀具优化 Created By: @禹翔辉 Accepted By: @禹翔辉 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/379?initial=true
This commit is contained in:
@@ -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('头部直径')
|
||||
|
||||
@@ -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('整体式刀具后角(°)')
|
||||
|
||||
@@ -194,50 +194,56 @@
|
||||
<group>
|
||||
<field name="integral_code" invisible="True"/>
|
||||
<field name="integral_total_length" string="总长度(mm)"/>
|
||||
<field name="integral_shank_length" string="柄部长度(mm)"/>
|
||||
<field name="mrs_materials_model_id" string="刀具材质" placeholder="请选择"
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<field name="integral_hardness" string="刀具硬度(HRC)"/>
|
||||
<field name="integral_blade_length" string="刃部长度(mm)"/>
|
||||
<field name="integral_neck_length" string="颈部长度(mm)"/>
|
||||
<field name="integral_blade_tip_taper" string="刀尖锥度(°)"/>
|
||||
<field name="integral_blade_helix_angle" string="刃部螺旋角(°)"/>
|
||||
<field name="integral_blade_diameter" string="刃部直径(mm)" class="diameter"/>
|
||||
<field name="integral_blade_type" string="刃部类型"/>
|
||||
<field name="mrs_materials_model_id" string="刀具材质" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<label for="integral_run_out_accuracy_min" string="端跳精度:"/>
|
||||
<div class="test_model">
|
||||
<label for="integral_run_out_accuracy_min" string="最小(min)"/>
|
||||
<field name="integral_run_out_accuracy_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="integral_run_out_accuracy_max" string="最大(max)"/>
|
||||
<field name="integral_run_out_accuracy_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="integral_blade_helix_angle" string="刃部螺旋角(°)"/>
|
||||
<field name="integral_blade_number" string="刃数(个)"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="integral_blade_number" string="刃数(个)"/>
|
||||
<field name="integral_shank_diameter" string="柄部直径(mm)"/>
|
||||
<field name="integral_blade_diameter" string="刃部直径(mm)"/>
|
||||
<field name="integral_neck_diameter" string="颈部直径(mm)"/>
|
||||
<field name="integral_blade_tip_diameter" string="刀尖直径(mm)"/>
|
||||
<field name="integral_hardness" string="刀具硬度(HRC)"/>
|
||||
<field name="integral_coarse_medium_fine" string="粗/中/精" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<field name="integral_shank_length" string="柄部长度(mm)"/>
|
||||
<field name="integral_shank_diameter" string="柄部直径(mm)" class="diameter"/>
|
||||
<field name="integral_neck_length" string="颈部长度(mm)"/>
|
||||
<field name="integral_neck_diameter" string="颈部直径(mm)" class="diameter"/>
|
||||
<field name="integral_blade_tip_diameter" string="刀尖直径(mm)" class="diameter"/>
|
||||
<field name="integral_blade_tip_taper" string="刀尖锥度(°)"/>
|
||||
<label for="integral_run_out_accuracy_min" string="端跳精度:"/>
|
||||
<div class="test_model">
|
||||
<label for="integral_run_out_accuracy_min" string="最小(min)"/>
|
||||
<field name="integral_run_out_accuracy_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="integral_run_out_accuracy_max" string="最大(max)"/>
|
||||
<field name="integral_run_out_accuracy_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="integral_coarse_medium_fine" string="粗/中/精" placeholder="请选择"
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<field name="integral_coating_material" string="涂层材质"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string=""/>
|
||||
<field name="suitable_machining_method_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""/>
|
||||
<group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string=""/>
|
||||
</group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string=""/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string=""/>
|
||||
<group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="切削速度Vc" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
|
||||
Reference in New Issue
Block a user