撤销制造-配置-刀具型号新增的参数;对产品刀具物料字段的限制优化
This commit is contained in:
@@ -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('前角(°)')
|
||||
|
||||
@@ -243,10 +243,6 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_neck_length" string="颈部长度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_type" string="刃部类型"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
<!--刀片-->
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
@@ -264,7 +260,7 @@
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="blade_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="blade_number"
|
||||
@@ -293,83 +289,32 @@
|
||||
<field name="blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="chuck_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀柄'))]}"/>
|
||||
<field name="handle_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头'))]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<!--整体式刀具-->
|
||||
<field name="integral_hardness" string="刀具硬度(HRC)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_coarse_medium_fine" string="粗/中/精"
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_shank_diameter" string="柄部直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_diameter" string="刃部直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_neck_diameter" string="颈部直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_tip_diameter" string="刀尖直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_helix_angle" string="刃部螺旋角(°)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_tip_taper" string="刀尖锥度(°)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
<field name="jump_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="front_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="coating_material"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="accuracy_level"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('整体式刀具','刀柄'))]}"/>
|
||||
<field name="working_hardness"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', '整体式刀具')]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄'))]}"/>
|
||||
<field name="working_hardness"/>
|
||||
<field name="wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄','刀杆','刀盘' ))]}"/>
|
||||
<field name="screw"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
<field name="nut"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<group>
|
||||
<group>
|
||||
<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>
|
||||
</group>
|
||||
</group>
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string=""/>
|
||||
</group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""/>
|
||||
</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=""/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user