产品新增刀具物料为刀片,刀盘,刀杆,夹头,刀柄,相关联的字段,及对应页面的优化
This commit is contained in:
@@ -261,7 +261,7 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .
|
||||
|
||||
.test_model > .o_form_label {
|
||||
margin-left: 4px !important;
|
||||
line-height: 0 !important;
|
||||
//line-height: 0 !important;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px) {
|
||||
|
||||
@@ -145,11 +145,17 @@
|
||||
attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_total_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀柄','夹头'))]}"/>
|
||||
|
||||
<field name="tool_width"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="tool_height"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_flange_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_shank_outer_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_shank_inner_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
|
||||
<!-- <field name="materials_type_id" options="{'no_create': True}" string="刀具材质"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"-->
|
||||
@@ -181,33 +187,93 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_shank_diameter" string="柄部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
|
||||
<!--刀片-->
|
||||
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_cutter_pad_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'/>
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<div class="test_model"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'>
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}">
|
||||
<label for="tool_length" string="长"/>
|
||||
<field name="tool_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_thickness" string="厚"/>
|
||||
<field name="tool_thickness" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_diameter" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_diameter" class="diameter" string="刃径"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_number"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
<!--夹头-->
|
||||
<field name="cutting_tool_cut_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_tip_circular_arc_radius"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<!-- <field name="cutting_tool_top_angle"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>-->
|
||||
<field name="cutting_tool_inscribed_circle_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_install_aperture_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_chip_breaker_groove"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
|
||||
<field name="cutting_tool_bladed_teeth_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_cut_depth_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_blade_number"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_width"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<!--刀杆-->
|
||||
<field name="cutting_tool_total_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','夹头','刀柄'))]}"/>
|
||||
<label for="cutting_tool_knife_head_length" string="刀头尺寸(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<div class="test_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}">
|
||||
<label for="cutting_tool_knife_head_length" string="长"/>
|
||||
<field name="cutting_tool_knife_head_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="cutting_tool_knife_head_width" string="宽"/>
|
||||
<field name="cutting_tool_knife_head_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<label for="cutting_tool_knife_head_height" string="高"/>
|
||||
<field name="cutting_tool_knife_head_height" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_blade_diameter" string="刃部直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
|
||||
<field name="cutting_tool_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
|
||||
<field name="cutting_tool_cutter_arbor_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_cut_blade_length" string="切削刃长度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_cut_depth_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_min_machining_aperture"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_install_blade_tip_num"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<!--刀盘-->
|
||||
<field name="cutting_tool_cutter_head_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
<field name="cutting_tool_interface_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
<field name="cutting_tool_clamping_way"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<!--夹头-->
|
||||
<field name="cutting_tool_clamping_length"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_clamping_tolerance"
|
||||
@@ -227,12 +293,15 @@
|
||||
attrs="{'required': [('cutting_tool_type','not in',('夹头','刀柄'))]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_head_diameter" class="diameter"
|
||||
<field name="cutting_tool_clamping_way"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_top_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_outer_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<field name="cutting_tool_inner_diameter" class="diameter"
|
||||
attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>
|
||||
<!--夹头-->
|
||||
|
||||
<field name="cutting_tool_standard_speed"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
@@ -242,8 +311,6 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_cooling_type"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_dynamic_balance_class"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<field name="materials_type_id" options="{'no_create': True}" placeholder="请选择"
|
||||
@@ -252,7 +319,7 @@
|
||||
<field name="cutting_tool_blade_type"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_coarse_medium_fine" string="粗/中/精" placeholder="请选择"
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<!--整体式刀具-->
|
||||
<field name="cutting_tool_blade_tip_working_size" string="刀尖直径(mm)" class="diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
@@ -277,43 +344,33 @@
|
||||
<field name="cutting_tool_taper"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
|
||||
<label for="cutting_tool_detection_accuracy_min" string="检测精度"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀柄"))]}'/>
|
||||
<div class="o_address_format"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀柄"))]}'>
|
||||
<label for="cutting_tool_detection_accuracy_min" string="最小"/>
|
||||
<field name="cutting_tool_detection_accuracy_min" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','=','刀柄')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="cutting_tool_detection_accuracy_max" string="最大"/>
|
||||
<field name="cutting_tool_detection_accuracy_max" class="o_address_zip"
|
||||
options="{'format': false}"
|
||||
attrs="{'required': [('cutting_tool_type','=','刀柄')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
<field name="cutting_tool_body_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_jump_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_front_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<!-- <field name="coating_material"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀柄'))]}"/>-->
|
||||
<field name="cutting_tool_accuracy_level"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄', '整体式刀具','夹头'))]}"/>
|
||||
<field name="cutting_tool_working_hardness"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('整体式刀具','夹头','刀柄'))]}"/>
|
||||
|
||||
<!-- <field name="tool_height" attrs='{"invisible": [("cutting_tool_type","!=","夹头")]}'/>-->
|
||||
|
||||
|
||||
<!-- <field name="cutting_tool_front_angle"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>-->
|
||||
<field name="cutting_tool_top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_blade_tip_dip_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_side_cutting_edge_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_thread_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_pitch"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_thread_num"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_blade_tip_height_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_inscribed_circle_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="cutting_tool_thickness_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<!--刀柄-->
|
||||
<field name="cutting_tool_is_rough_finish"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_is_finish"
|
||||
@@ -328,40 +385,44 @@
|
||||
|
||||
<field name="cutting_tool_jump_accuracy" string="跳动精度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="coating_material"
|
||||
<field name="cutting_tool_max_load_capacity"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cutting_tool_er_size_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<!-- <field name="cutting_tool_handle_ids" widget="many2many_tags"-->
|
||||
<!-- options="{'no_create': True}"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>-->
|
||||
<field name="cutting_tool_handle_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="cooling_suit_type_ids"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
|
||||
<field name="cutting_tool_wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘' ))]}"/>
|
||||
<!-- <field name="cutting_tool_screw"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀柄'))]}"/>-->
|
||||
<field name="cutting_tool_nut"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
|
||||
<!-- <field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"-->
|
||||
<!-- options="{'no_create': True}"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>-->
|
||||
<!-- <field name="cutting_tool_cutter_pad_ids" widget="many2many_tags"-->
|
||||
<!-- options="{'no_create': True}"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>-->
|
||||
<!-- <field name="cutting_tool_blade_ids" widget="many2many_tags"-->
|
||||
<!-- options="{'no_create': True}"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>-->
|
||||
|
||||
<!-- <field name="cutting_tool_chuck_ids" widget="many2many_tags"-->
|
||||
<!-- options="{'no_create': True}"-->
|
||||
<!-- attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄'))]}"/>-->
|
||||
<field name="apply_lock_nut_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="apply_lock_wrench_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<!-- 刀杆 -->
|
||||
<field name="cutting_tool_installing_structure"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_cooling_hole"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_locating_slot_code"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_tool_shim"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_cotter_pin"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_pressing_plate"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')]}"/>
|
||||
<field name="cutting_tool_screw"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<!-- 刀盘 -->
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀盘')]}"/>
|
||||
|
||||
</group>
|
||||
</group>
|
||||
<group string="适配刀片形状"
|
||||
|
||||
@@ -96,6 +96,7 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_blade_width = fields.Char('刃部宽度(mm)', size=20)
|
||||
cutting_tool_blade_depth = fields.Char('刃部深度(mm)', size=20)
|
||||
cutting_tool_cut_depth = fields.Char('切削深度(mm)', size=20)
|
||||
cutting_tool_cut_depth_max = fields.Char('最大切削深度(mm)', size=20)
|
||||
cutting_tool_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '粗/中/精')
|
||||
cutting_tool_run_out_accuracy_max = fields.Float('端跳精度max', digits=(6, 1))
|
||||
cutting_tool_run_out_accuracy_min = fields.Float('端跳精度min', digits=(6, 1))
|
||||
@@ -115,7 +116,50 @@ class ResProductMo(models.Model):
|
||||
suitable_coolant_ids = fields.Many2many('maintenance.equipment.image', 'rel_coolant_product_template',
|
||||
'适合冷却液', domain=[('type', '=', '冷却液')])
|
||||
compaction_way_ids = fields.Many2many('maintenance.equipment.image', 'rel_compaction_product_template',
|
||||
'压紧方式', domain=[('type', '=', '压紧方式')])
|
||||
'压紧方式', domain=[('type', '=', '压紧方式')])\
|
||||
|
||||
|
||||
@api.onchange('cutting_tool_material_id')
|
||||
def _onchange_cutting_tool_material_id(self):
|
||||
for item in self:
|
||||
if item.cutting_tool_material_id.id != item.cutting_tool_model_id.cutting_tool_material_id.id:
|
||||
item.cutting_tool_model_id = False
|
||||
item.specification_id = False
|
||||
item.cutting_tool_type_id = False
|
||||
item.brand_id = False
|
||||
item.tool_hardness = False
|
||||
item.cutting_tool_run_out_accuracy_max = False
|
||||
item.cutting_tool_run_out_accuracy_min = False
|
||||
item.materials_type_id = False
|
||||
item.cutting_tool_blade_type = False
|
||||
item.cutting_tool_total_length = False
|
||||
item.cutting_tool_shank_length = False
|
||||
item.cutting_tool_blade_length = False
|
||||
item.cutting_tool_blade_number = False
|
||||
item.cutting_tool_neck_length = False
|
||||
item.cutting_tool_neck_diameter = False
|
||||
item.cutting_tool_shank_diameter = False
|
||||
item.cutting_tool_blade_tip_diameter = False
|
||||
item.cutting_tool_blade_tip_taper = False
|
||||
item.cutting_tool_blade_helix_angle = False
|
||||
item.cutting_tool_blade_type = False
|
||||
item.cutting_tool_pitch = False
|
||||
item.cutting_tool_blade_width = False
|
||||
item.cutting_tool_blade_depth = False
|
||||
item.cutting_tool_cut_depth = False
|
||||
item.cutting_tool_coarse_medium_fine = False
|
||||
item.cutting_tool_run_out_accuracy_max = False
|
||||
item.cutting_tool_run_out_accuracy_min = False
|
||||
item.cutting_tool_blade_tip_working_size = False
|
||||
item.fit_blade_shape_ids = False
|
||||
item.suitable_machining_method_ids = False
|
||||
item.blade_tip_characteristics_ids = False
|
||||
item.handle_type_ids = False
|
||||
item.cutting_direction_ids = False
|
||||
item.suitable_coolant_ids = False
|
||||
item.compaction_way_ids = False
|
||||
item.cutting_speed_ids = False
|
||||
item.feed_per_tooth_ids = False
|
||||
|
||||
@api.onchange('specification_id')
|
||||
def _onchange_specification(self):
|
||||
@@ -123,9 +167,13 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_type_id = self.cutting_tool_model_id.cutting_tool_type_id.id
|
||||
self.brand_id = self.cutting_tool_model_id.brand_id.id
|
||||
self.tool_hardness = self.cutting_tool_model_id.tool_hardness
|
||||
self.cutting_tool_run_out_accuracy_max = self.cutting_tool_model_id.integral_run_out_accuracy_max
|
||||
self.cutting_tool_run_out_accuracy_min = self.cutting_tool_model_id.integral_run_out_accuracy_min
|
||||
self.materials_type_id = self.cutting_tool_model_id.material_model_id.id
|
||||
if self.cutting_tool_type == '整体式刀具':
|
||||
self.cutting_tool_run_out_accuracy_max = self.cutting_tool_model_id.integral_run_out_accuracy_max
|
||||
self.cutting_tool_run_out_accuracy_min = self.cutting_tool_model_id.integral_run_out_accuracy_min
|
||||
elif self.cutting_tool_type == '刀片':
|
||||
self.cutting_tool_cutter_bar_ids = self.cutting_tool_model_id.cutting_tool_cutter_bar_ids.ids,
|
||||
self.cutting_tool_cutter_pad_ids = self.cutting_tool_model_id.cutting_tool_cutter_pad_ids.ids,
|
||||
self.cutting_tool_blade_type = self.cutting_tool_model_id.blade_type
|
||||
self.cutting_tool_coarse_medium_fine = self.cutting_tool_model_id.integral_coarse_medium_fine
|
||||
self.coating_material = self.cutting_tool_model_id.coating_material
|
||||
@@ -150,15 +198,18 @@ class ResProductMo(models.Model):
|
||||
self.compaction_way_ids = [(6, 0,
|
||||
[])] if not self.cutting_tool_model_id.compaction_way_ids else [
|
||||
(6, 0, self.cutting_tool_model_id.compaction_way_ids.ids)]
|
||||
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||
self.feed_per_tooth_ids = [(0, 0, {'product_template_id': product_template.id,
|
||||
'cutting_speed': product_template.cutting_speed,
|
||||
'machining_method': product_template.machining_method,
|
||||
'blade_diameter': product_template.blade_diameter,
|
||||
'materials_type_id': product_template.materials_type_id.id}) for
|
||||
product_template in
|
||||
self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
|
||||
lambda r: r.blade_diameter == self.specification_id.blade_diameter)]
|
||||
if self.cutting_tool_type == '整体式刀具':
|
||||
self.cutting_speed_ids = self.cutting_tool_model_id.cutting_speed_ids
|
||||
self.feed_per_tooth_ids = [(0, 0, {'product_template_id': product_template.id,
|
||||
'cutting_speed': product_template.cutting_speed,
|
||||
'machining_method': product_template.machining_method,
|
||||
'blade_diameter': product_template.blade_diameter,
|
||||
'materials_type_id': product_template.materials_type_id.id}) for
|
||||
product_template in
|
||||
self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
|
||||
lambda r: r.blade_diameter == self.specification_id.blade_diameter)]
|
||||
|
||||
|
||||
|
||||
# @api.constrains('suitable_machining_method_ids')
|
||||
# def _check_suitable_machining_method_ids(self):
|
||||
@@ -248,52 +299,91 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_rear_angle = fields.Integer('后角(°)')
|
||||
cutting_tool_main_included_angle = fields.Integer('主偏角(°)')
|
||||
# cutting_tool_material_model_id = fields.Many2one('sf.materials.model', '材料型号')
|
||||
cutting_tool_nut = fields.Float('配对螺母(mm)')
|
||||
# 适用夹头型号可以多选
|
||||
cutting_tool_chuck_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_handle_chuck_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_handle_chuck_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '夹头')]",
|
||||
string='适用夹头型号')
|
||||
# 刀片参数
|
||||
cutting_tool_cut_blade_length = fields.Char('切削刃长(mm)', size=20)
|
||||
cutting_tool_blade_tip_circular_arc_radius = fields.Char('刀尖圆弧半径(mm)', size=20)
|
||||
cutting_tool_top_angle = fields.Integer('顶角(°)')
|
||||
cutting_tool_inscribed_circle_diameter = fields.Char('内接圆直径(mm)', size=20)
|
||||
cutting_tool_install_aperture_diameter = fields.Char('安装孔直径(mm)', size=20)
|
||||
cutting_tool_chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')],
|
||||
string='有无断屑槽')
|
||||
cutting_tool_bladed_teeth_model = fields.Selection(
|
||||
[('无', '无'), ('V牙型', 'V牙型'), ('米制全牙型', '米制全牙型'), ('美制全牙型', '美制全牙型'),
|
||||
('惠氏全牙型', '惠氏全牙型'), ('BSPT全牙型', 'BSPT全牙型'), ('NPT全牙型', 'NPT全牙型'),
|
||||
('UNJ全牙型', 'UNJ全牙型'), ('DIN405圆牙型', 'DIN405圆牙型'), ('ACME梯形', 'ACME梯形'),
|
||||
('石油管螺纹刀片', '石油管螺纹刀片'), ('矮牙ACME梯形', '矮牙ACME梯形'),
|
||||
('Trapeze30° 103', 'Trapeze30° 103')], string='刀片牙型')
|
||||
cutting_tool_blade_blade_number = fields.Selection(
|
||||
[('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'),
|
||||
('7', '7'), ('8', '8'), ('9', '9'), ('10', '10')],
|
||||
string='刀片的刃数(个)')
|
||||
|
||||
cutting_tool_blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
||||
cutting_tool_side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
||||
cutting_tool_thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')], string='螺纹类型')
|
||||
cutting_tool_thread_num = fields.Char('每英寸螺纹数(tpi)', size=20)
|
||||
cutting_tool_blade_tip_height_tolerance = fields.Char('刀尖高度公差(mm)', size=20)
|
||||
cutting_tool_inscribed_circle_tolerance = fields.Char('内接圆公差(mm)', size=20)
|
||||
cutting_tool_thickness_tolerance = fields.Char('厚度公差(mm)', size=20)
|
||||
|
||||
cutting_tool_jump_accuracy = fields.Float('径跳精度(mm)')
|
||||
cutting_tool_working_hardness = fields.Char('加工硬度(hrc)')
|
||||
cutting_tool_cutter_bar_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_blade_cutter_bar_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_cutter_bar_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀杆')]",
|
||||
string='适用刀杆型号'
|
||||
)
|
||||
cutting_tool_cutter_pad_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_blade_cutter_pad_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_cutter_pad_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀盘')]",
|
||||
string='适用刀盘型号' # 使用空列表作为默认值
|
||||
)
|
||||
# 刀杆/参数
|
||||
cutting_tool_knife_head_height = fields.Float('刀头高度(mm)')
|
||||
cutting_tool_knife_head_width = fields.Float('刀头宽度(mm)')
|
||||
cutting_tool_knife_head_length = fields.Float('刀头长度(mm)')
|
||||
cutting_tool_blade_diameter = fields.Float('刃径/刃部直径(mm)')
|
||||
cutting_tool_cutter_arbor_diameter = fields.Char('刀杆直径(mm)', size=20)
|
||||
cutting_tool_min_machining_aperture = fields.Char('最小加工孔径(mm)', size=20)
|
||||
cutting_tool_install_blade_tip_num = fields.Char('可装刀片数/齿数(个)', size=20)
|
||||
cutting_tool_installing_structure = fields.Char('安装结构', size=20)
|
||||
cutting_tool_blade_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='product_cutting_tool_model_pad_blade_rel',
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀片')]",
|
||||
string='适用刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
cutting_tool_wrench = fields.Float('配对扳手(mm)')
|
||||
# cutting_tool_screw = fields.Float('配备螺丝(mm)')
|
||||
cutting_tool_accuracy_level = fields.Char('精度等级')
|
||||
cutting_tool_tool_shim = fields.Char('适配刀垫型号', size=50)
|
||||
cutting_tool_cotter_pin = fields.Char('适配销钉型号', size=50)
|
||||
cutting_tool_pressing_plate = fields.Char('适配压板型号', size=50)
|
||||
cutting_tool_screw = fields.Char('适配螺钉型号', size=50)
|
||||
cutting_tool_wrench = fields.Char('适配扳手型号')
|
||||
cutting_tool_cooling_hole = fields.Selection([('有', '有'), ('无', '无')], string='有无冷却孔')
|
||||
cutting_tool_locating_slot_code = fields.Char('定位槽代号', size=20)
|
||||
|
||||
# 刀盘参数
|
||||
cutting_tool_cutter_head_diameter = fields.Char('刀盘直径(mm)', size=20)
|
||||
cutting_tool_interface_diameter = fields.Char('接口直径(mm)', size=20)
|
||||
|
||||
# 刀柄参数
|
||||
cutting_tool_head_diameter = fields.Float('头部直径')
|
||||
cutting_tool_diameter_max = fields.Float('最大直径(mm)')
|
||||
cutting_tool_clamping_diameter = fields.Float('夹持直径(mm)')
|
||||
cutting_tool_shank_outer_diameter = fields.Float('柄部外径(mm)')
|
||||
cutting_tool_shank_inner_diameter = fields.Float('柄部内径(mm)')
|
||||
cutting_tool_clamping_length = fields.Float('夹持长度(mm)')
|
||||
cutting_tool_clamping_tolerance = fields.Float('夹持公差(mm)')
|
||||
cutting_tool_clamping_diameter_max = fields.Float('最大夹持直径')
|
||||
@@ -305,47 +395,32 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_is_drill_hole = fields.Boolean('可钻孔', default=False)
|
||||
cutting_tool_is_safety_lock = fields.Boolean('安全锁', default=False)
|
||||
cutting_tool_is_high_speed_cutting = fields.Boolean('可高速切削', default=False)
|
||||
cutting_tool_dynamic_balance_class = fields.Char('动平衡等级')
|
||||
cutting_tool_change_time = fields.Integer('换刀时间(s)')
|
||||
cutting_tool_clamping_way = fields.Char('夹持方式')
|
||||
cutting_tool_standard_speed = fields.Integer('标准转速(n/min)')
|
||||
cutting_tool_speed_max = fields.Integer('最大转速(n/min)')
|
||||
cutting_tool_cooling_type = fields.Char('冷却类型')
|
||||
cutting_tool_body_accuracy = fields.Float('本体精度(mm)')
|
||||
apply_lock_nut_model = fields.Char('适用锁紧螺母型号')
|
||||
apply_lock_wrench_model = fields.Char('适用锁紧扳手型号')
|
||||
cutting_tool_detection_accuracy_max = fields.Float('最大检测精度(mm)')
|
||||
cutting_tool_detection_accuracy_min = fields.Float('最小检测精度(mm)')
|
||||
|
||||
# 夹头参数
|
||||
cutting_tool_taper = fields.Integer('锥度(°)')
|
||||
cutting_tool_top_diameter = fields.Float('顶部直径')
|
||||
cutting_tool_outer_diameter = fields.Float('外径(mm)')
|
||||
cutting_tool_inner_diameter = fields.Float('内径(mm)')
|
||||
cooling_suit_type_ids = fields.Char('适用冷却套型号')
|
||||
# cooling_suit_type_ids = fields.Many2many('冷却类型')
|
||||
cutting_tool_max_load_capacity = fields.Float('最大负载能力(kg)')
|
||||
cutting_tool_er_size_model = fields.Char('ER尺寸型号')
|
||||
# cutting_tool_handle_ids = fields.Many2many(
|
||||
# 'sf.cutting.tool.model',
|
||||
# relation='product_cutting_tool_model_chuck_handle_rel',
|
||||
# column1='model_id_1',
|
||||
# column2='model_id_2',
|
||||
# domain="[('cutting_tool_type', '=', '刀柄')]",
|
||||
# string='适用刀柄型号'
|
||||
# )
|
||||
cutting_tool_handle_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_chuck_handle_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
|
||||
|
||||
# @api.onchange('cutting_tool_model_id')
|
||||
# def onchange_method(self):
|
||||
# if self.cutting_tool_model_id:
|
||||
# return {
|
||||
# 'name': 'Import your first bill',
|
||||
# 'view_mode': 'form',
|
||||
# 'target': 'new',
|
||||
# 'view_type': 'form',
|
||||
# 'res_model': 'sf.cutting_tool.standard.library',
|
||||
# 'context': {'default_res_id': self.cutting_tool_model_id.id},
|
||||
# 'views': [[False, 'form']],
|
||||
# 'res_id': self.cutting_tool_model_id.id,
|
||||
# 'type': 'ir.actions.act_window',
|
||||
# }
|
||||
# 夹具参数
|
||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料")
|
||||
fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号")
|
||||
@@ -474,9 +549,6 @@ class ResProductMo(models.Model):
|
||||
self.detailed_type = 'product'
|
||||
self.sale_ok = False
|
||||
|
||||
# @api.onchange('cutting_tool_material_id')
|
||||
# def _onchange_cutting_tool_material_id(self):
|
||||
# if self.cutting_tool_material_id:
|
||||
|
||||
@api.onchange('fixture_material_id')
|
||||
def _onchange_fixture_material_id(self):
|
||||
|
||||
Reference in New Issue
Block a user