优化刀具模版和刀具标准库
This commit is contained in:
@@ -111,11 +111,16 @@ class CuttingToolModel(models.Model):
|
||||
|
||||
material_model_id = fields.Many2one('sf.materials.model', '材料型号')
|
||||
# 适用夹头型号可以多选
|
||||
chuck_ids = fields.Many2many(
|
||||
# chuck_ids = fields.Many2many(
|
||||
# 'sf.cutting_tool.standard.library',
|
||||
# relation='cutting_tool_type_library_handle_chuck_rel',
|
||||
# column1='model_id_1',
|
||||
# column2='model_id_2',
|
||||
# domain="[('cutting_tool_material_id.name', '=', '夹头')]",
|
||||
# string='适用夹头型号')
|
||||
|
||||
chuck_id = fields.Many2one(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_handle_chuck_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '夹头')]",
|
||||
string='适用夹头型号')
|
||||
cutter_bar_ids = fields.Many2many(
|
||||
@@ -135,22 +140,28 @@ class CuttingToolModel(models.Model):
|
||||
string='适用刀盘型号' # 使用空列表作为默认值
|
||||
)
|
||||
# 刀杆/参数
|
||||
blade_ids = fields.Many2many(
|
||||
# blade_ids = fields.Many2many(
|
||||
# 'sf.cutting_tool.standard.library',
|
||||
# relation='cutting_tool_type_library_pad_blade_rel',
|
||||
# column1='model_id_1',
|
||||
# column2='model_id_2',
|
||||
# domain="[('cutting_tool_material_id.name', '=', '刀片')]",
|
||||
# string='适用刀片型号' # 使用空列表作为默认值
|
||||
# )
|
||||
|
||||
handle_id = fields.Many2one(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀片')]",
|
||||
string='适用刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
handle_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='cutting_tool_type_library_chuck_handle_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
# handle_ids = fields.Many2many(
|
||||
# 'sf.cutting_tool.standard.library',
|
||||
# relation='cutting_tool_type_library_chuck_handle_rel',
|
||||
# column1='model_id_1',
|
||||
# column2='model_id_2',
|
||||
# domain="[('cutting_tool_material_id.name', '=', '刀柄')]",
|
||||
# string='适用刀柄型号'
|
||||
# )
|
||||
active = fields.Boolean('有效', default=True)
|
||||
is_cloud = fields.Boolean('云端数据', default=False)
|
||||
|
||||
@@ -172,7 +183,7 @@ class MaintenanceStandardImage(models.Model):
|
||||
image = fields.Binary(string='图文')
|
||||
type = fields.Selection(
|
||||
[('加工能力', '加工能力'), ('刀尖特征', '刀尖特征'), ('柄部类型', '柄部类型'), ('走刀方向', '走刀方向'),
|
||||
('冷却液', '冷却液'), ('压紧方式', '压紧方式'), ('刀片形状', '刀片形状'), ('冷却方式', '冷却方式')],
|
||||
('压紧方式', '压紧方式'), ('刀片形状', '刀片形状'), ('冷却方式', '冷却方式')],
|
||||
string='特征')
|
||||
equipment_id = fields.Many2many('maintenance.equipment', 'image_id', string='设备')
|
||||
equipment_lq_id = fields.Many2many('maintenance.equipment', 'image_lq_id', string='设备')
|
||||
|
||||
@@ -54,8 +54,6 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
string='刀片的刃数(个)', default='0')
|
||||
main_included_angle = fields.Integer('主偏角(°)')
|
||||
top_angle = fields.Integer('顶角(°)')
|
||||
blade_tip_dip_angle = fields.Integer('刀尖倾角(°)')
|
||||
side_cutting_edge_angle = fields.Integer('侧切削角(°)')
|
||||
thread_model = fields.Selection([('无', '无'), ('外螺纹', '外螺纹'), ('内螺纹', '内螺纹')], string='螺纹类型',
|
||||
default='无')
|
||||
thread_num = fields.Float('每英寸螺纹数(tpi)')
|
||||
@@ -90,7 +88,7 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
cutter_head_diameter = fields.Float('刀盘直径(mm)')
|
||||
interface_diameter = fields.Float('接口直径(mm)')
|
||||
# 刀柄参数
|
||||
flange_shank_length = fields.Float('法兰柄长(mm)')
|
||||
flange_shank_length = fields.Float('法兰长(mm)')
|
||||
flange_diameter = fields.Float('法兰直径(mm)')
|
||||
fit_chuck_size = fields.Char('适配夹头尺寸')
|
||||
handle_external_diameter = fields.Float('柄部外径(mm)')
|
||||
@@ -109,17 +107,14 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
diameter_slip_accuracy = fields.Char('径跳精度(mm)', size=20)
|
||||
cooling_model = fields.Char('冷却类型', size=20)
|
||||
taper_shank_model = fields.Char('锥柄型号')
|
||||
is_rough_machining = fields.Boolean('可粗加工', default=False)
|
||||
is_finish_machining = fields.Boolean('可精加工', default=False)
|
||||
is_quick_cutting = fields.Boolean('可高速切削', default=False)
|
||||
is_drill_hole = fields.Boolean('可钻孔', default=False)
|
||||
is_safe_lock = fields.Boolean('有无安全锁', default=False)
|
||||
chuck_id = fields.Many2one(
|
||||
'sf.cutting_tool.standard.library',
|
||||
domain="[('cutting_tool_material_id.name', '=', '夹头')]",
|
||||
string='适配夹头型号' # 使用空列表作为默认值
|
||||
)
|
||||
nut = fields.Char('适用锁紧螺母型号')
|
||||
nut = fields.Char('适配锁紧螺母型号')
|
||||
|
||||
# 夹头参数
|
||||
er_size_model = fields.Char('ER尺寸型号', size=20)
|
||||
@@ -131,11 +126,6 @@ class ToolMaterialsBasicParameters(models.Model):
|
||||
clamping_length = fields.Float('夹持长度(mm)')
|
||||
clamping_tolerance = fields.Char('夹持公差(mm)', size=20)
|
||||
cooling_jacket = fields.Char('适用冷却套型号', size=50)
|
||||
handle_id = fields.Many2one(
|
||||
'sf.cutting_tool.standard.library',
|
||||
domain="[('cutting_tool_material_id.name', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
active = fields.Boolean(string='有效', default=True)
|
||||
|
||||
|
||||
|
||||
@@ -46,8 +46,6 @@
|
||||
<field name="blade_blade_number"/>
|
||||
<field name="main_included_angle" />
|
||||
<field name="top_angle" />
|
||||
<field name="blade_tip_dip_angle"/>
|
||||
<field name="side_cutting_edge_angle"/>
|
||||
<field name="thread_model"/>
|
||||
<field name="thread_num" />
|
||||
<field name="blade_tip_height_tolerance" />
|
||||
|
||||
@@ -157,6 +157,12 @@
|
||||
<field name="cutter_pad_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}" search="[]"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')]}"/>
|
||||
<field name="handle_id" placeholder="请选择"
|
||||
options="{'no_create': True}" search="[]"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '夹头')]}"/>
|
||||
<field name="chuck_id" placeholder="请选择"
|
||||
options="{'no_create': True}" search="[]"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="material_model_id" placeholder="请选择" string="材质"
|
||||
@@ -197,7 +203,7 @@
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<group string="适合冷却方式">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -223,7 +229,7 @@
|
||||
<field name="pitch"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_depth"/>
|
||||
<field name="cutting_depth"/>
|
||||
<field name="cut_depth_max"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -234,24 +240,22 @@
|
||||
<field name="name"/>
|
||||
<field name="length"/>
|
||||
<field name="thickness"/>
|
||||
<field name="width"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="relief_angle" class="du"/>
|
||||
<field name="blade_tip_circular_arc_radius"/>
|
||||
<field name="inscribed_circle_diameter" class="diameter"/>
|
||||
<field name="install_aperture_diameter" class="diameter"/>
|
||||
<field name="pitch"/>
|
||||
<field name="blade_tip_circular_arc_radius" string="刀尖圆弧半径RE(mm)"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="relief_angle" class="du"/>
|
||||
<field name="chip_breaker_groove" placeholder="请选择"/>
|
||||
<field name="chip_breaker_type_code"/>
|
||||
<field name="blade_teeth_model" placeholder="请选择"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="thread_model" placeholder="请选择"/>
|
||||
<field name="pitch"/>
|
||||
<field name="thread_num"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="blade_blade_number" string="刃数(个)"/>
|
||||
<field name="blade_width" string="刃宽(mm)"/>
|
||||
<field name="main_included_angle"/>
|
||||
<field name="top_angle"/>
|
||||
<field name="blade_tip_dip_angle"/>
|
||||
<field name="side_cutting_edge_angle"/>
|
||||
<field name="thread_model" placeholder="请选择"/>
|
||||
<field name="thread_num"/>
|
||||
<field name="blade_tip_height_tolerance"/>
|
||||
<field name="inscribed_circle_tolerance"/>
|
||||
<field name="thickness_tolerance"/>
|
||||
@@ -262,29 +266,29 @@
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="height"/>
|
||||
<field name="width"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_height"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="width"/>
|
||||
<field name="height"/>
|
||||
<field name="knife_head_length"/>
|
||||
<field name="knife_head_width"/>
|
||||
<field name="knife_head_height"/>
|
||||
<field name="blade_diameter" class="diameter"/>
|
||||
<field name="cutter_arbor_diameter" class="diameter"/>
|
||||
<field name="main_included_angle" class="du"/>
|
||||
<field name="relief_angle" class="du"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="cutting_blade_length"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="min_machining_aperture" class="diameter"/>
|
||||
<field name="install_blade_tip_num"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="is_cooling_hole"/>
|
||||
<field name="locating_slot_code"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_id" placeholder="请选择"/>
|
||||
<field name="blade_id" placeholder="请选择"/>
|
||||
<field name="tool_shim"/>
|
||||
<field name="cotter_pin"/>
|
||||
<field name="pressing_plate"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
<field name="is_cooling_hole"/>
|
||||
<field name="locating_slot_code"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -299,13 +303,13 @@
|
||||
<field name="interface_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="cutting_depth" string="最大切削深度(mm)"/>
|
||||
<field name="cutting_blade_length" string="切削刃长度(mm)"/>
|
||||
<field name="cut_depth_max"/>
|
||||
<field name="main_included_angle" class="du"/>
|
||||
<field name="installing_structure"/>
|
||||
<field name="blade_id" placeholder="请选择"/>
|
||||
<field name="blade_id" placeholder="请选择"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
<field name="cutting_blade_model"/>
|
||||
<field name="is_cooling_hole"/>
|
||||
<field name="locating_slot_code"/>
|
||||
</tree>
|
||||
@@ -316,26 +320,25 @@
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="taper_shank_model"/>
|
||||
<field name="total_length"/>
|
||||
<field name="shank_length"/>
|
||||
<field name="shank_diameter" class="diameter"/>
|
||||
<field name="flange_shank_length"/>
|
||||
<field name="handle_inside_diameter" class="diameter"/>
|
||||
<field name="flange_diameter"/>
|
||||
<field name="diameter_slip_accuracy"/>
|
||||
<field name="dynamic_balance_class"/>
|
||||
<field name="min_clamping_diameter" class="diameter"/>
|
||||
<field name="max_clamping_diameter" class="diameter"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="taper" class="du"/>
|
||||
<field name="tool_changing_time"/>
|
||||
<field name="standard_rotate_speed"/>
|
||||
<field name="max_rotate_speed"/>
|
||||
<field name="diameter_slip_accuracy"/>
|
||||
<field name="fit_chuck_size"/>
|
||||
<field name="nut"/>
|
||||
<field name="spanner" string="适配锁紧扳手型号"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="tool_changing_time"/>
|
||||
<field name="cooling_model"/>
|
||||
<field name="is_rough_machining"/>
|
||||
<field name="is_finish_machining"/>
|
||||
<field name="is_quick_cutting"/>
|
||||
<field name="is_drill_hole"/>
|
||||
<field name="is_safe_lock"/>
|
||||
<field name="screw"/>
|
||||
<field name="spanner"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="chuck_basic_parameters_ids"
|
||||
@@ -343,21 +346,17 @@
|
||||
<tree editable="bottom" class="center" delete="1">
|
||||
<field name="cutting_tool_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="er_size_model"/>
|
||||
<field name="er_size_model" string="尺寸型号"/>
|
||||
<field name="min_clamping_diameter" class="diameter" required="1"/>
|
||||
<field name="max_clamping_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="outer_diameter" class="diameter"/>
|
||||
<field name="inner_diameter" class="diameter"/>
|
||||
<field name="total_length"/>
|
||||
<field name="taper" class="du"/>
|
||||
<field name="run_out_accuracy"/>
|
||||
<field name="top_diameter" class="diameter"/>
|
||||
<field name="weight"/>
|
||||
<field name="clamping_mode"/>
|
||||
<field name="clamping_length"/>
|
||||
<field name="clamping_tolerance"/>
|
||||
<field name="max_load_capacity"/>
|
||||
<field name="handle_id" placeholder="请选择"/>
|
||||
<field name="cooling_jacket"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -176,6 +176,10 @@
|
||||
options="{'format': false}"
|
||||
attrs="{'readonly': [('id', '!=', False)]}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_blade_blade_number" string="刃数"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_blade_width" string="刃宽"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_cut_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_blade_tip_circular_arc_radius"
|
||||
@@ -194,10 +198,6 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_cut_depth_max"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_blade_blade_number" string="刃数"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_blade_width" string="刃宽"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<!--刀杆-->
|
||||
|
||||
<label for="cutting_tool_knife_head_length" string="刀头尺寸(mm)"
|
||||
@@ -314,12 +314,12 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_bladed_teeth_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_thickness_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_thread_model"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_thread_num"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_thickness_tolerance"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_cutter_bar_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀片')],'readonly': [('id', '!=', False)]}"/>
|
||||
@@ -352,7 +352,7 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_locating_slot_code"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_blade_ids" widget="many2many_tags"
|
||||
<field name="cutting_tool_blade_id"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_tool_shim"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀杆')],'readonly': [('id', '!=', False)]}"/>
|
||||
@@ -366,7 +366,7 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀柄'))],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_chuck_ids" widget="many2many_tags"
|
||||
<field name="cutting_tool_chuck_id"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')],'readonly': [('id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_fit_chuck_size"
|
||||
@@ -413,7 +413,7 @@
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"
|
||||
attrs="{'readonly': [('id', '!=', False)]}"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<group string="适合冷却方式">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"
|
||||
attrs="{'readonly': [('id', '!=', False)]}"/>
|
||||
</group>
|
||||
|
||||
@@ -14,5 +14,4 @@ access_maintenance_standard_image_group_plan_dispatch,maintenance_standard_image
|
||||
access_equipment_maintenance_standards_group_plan_dispatch,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_maintenance_standards_group_plan_dispatch,maintenance_standards,model_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0
|
||||
|
||||
access_maintenance_equipment_tool_group_plan_dispatch,maintenance.equipment.tool,sf_manufacturing.model_maintenance_equipment_tool,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_sf_robot_axis_num_group_plan_dispatch,sf.robot.axis.num,model_sf_robot_axis_num,sf_base.group_plan_dispatch,1,0,0,0
|
||||
|
@@ -6,10 +6,8 @@ import os
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.modules import get_resource_path
|
||||
|
||||
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
@@ -204,7 +202,6 @@ class ResProductMo(models.Model):
|
||||
self.feed_per_tooth_ids = self.cutting_tool_model_id.feed_per_tooth_ids.filtered(
|
||||
lambda r: int(r.blade_diameter) == int(self.specification_id.blade_diameter))
|
||||
elif self.cutting_tool_type == '夹头':
|
||||
self.cutting_tool_clamping_length = self.specification_id.clamping_length
|
||||
self.cutting_tool_clamping_tolerance = self.specification_id.clamping_tolerance
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.max_clamping_diameter
|
||||
@@ -236,8 +233,6 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_rear_angle = self.specification_id.relief_angle
|
||||
self.cutting_tool_main_included_angle = self.specification_id.main_included_angle
|
||||
self.cutting_tool_top_angle = self.specification_id.top_angle
|
||||
self.cutting_tool_blade_tip_dip_angle = self.specification_id.blade_tip_dip_angle
|
||||
self.cutting_tool_side_cutting_edge_angle = self.specification_id.side_cutting_edge_angle
|
||||
self.cutting_tool_pitch = self.specification_id.pitch
|
||||
self.cutting_tool_bladed_teeth_model = self.specification_id.blade_teeth_model
|
||||
self.cutting_tool_thickness_tolerance = self.specification_id.thickness_tolerance
|
||||
@@ -265,7 +260,14 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_rear_angle = self.specification_id.relief_angle
|
||||
self.cutting_tool_main_included_angle = self.specification_id.main_included_angle
|
||||
self.cutting_tool_top_angle = self.specification_id.top_angle
|
||||
self.cutting_tool_blade_tip_dip_angle = self.specification_id.blade_tip_dip_angle
|
||||
self.cutting_tool_screw = self.specification_id.screw
|
||||
self.cutting_tool_wrench = self.specification_id.wrench
|
||||
self.cutting_tool_blade_id = self.specification_id.blade_id
|
||||
self.cutting_tool_is_cooling_hole = self.specification_id.is_cooling_hole
|
||||
self.cutting_tool_locating_slot_code = self.specification_id.locating_slot_code
|
||||
self.cutting_tool_install_blade_tip_num = self.specification_id.install_blade_tip_num
|
||||
self.cutting_tool_installing_structure = self.specification_id.installing_structure
|
||||
self.cutting_tool_cut_depth_max = self.specification_id.cut_depth_max
|
||||
if self.cutting_tool_type == '刀盘':
|
||||
self.cutting_tool_blade_length = self.specification_id.blade_length
|
||||
self.cutting_tool_cutter_head_diameter = self.specification_id.cutter_head_diameter
|
||||
@@ -274,6 +276,9 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_knife_head_height = self.specification_id.knife_head_height
|
||||
self.cutting_tool_knife_head_width = self.specification_id.knife_head_width
|
||||
self.cutting_tool_knife_head_length = self.specification_id.knife_head_length
|
||||
self.cutting_tool_tool_shim = self.specification_id.tool_shim
|
||||
self.cutting_tool_cotter_pin = self.specification_id.cotter_pin
|
||||
self.cutting_tool_pressing_plate = self.specification_id.pressing_plate
|
||||
elif self.cutting_tool_type == '刀柄':
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.cutting_tool_speed_max = self.specification_id.max_rotate_speed
|
||||
@@ -285,6 +290,13 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_flange_diameter = self.specification_id.flange_diameter
|
||||
self.cutting_tool_fit_chuck_size = self.specification_id.fit_chuck_size
|
||||
self.cutting_tool_dynamic_balance_class = self.specification_id.dynamic_balance_class
|
||||
self.cutting_tool_is_high_speed_cutting = self.specification_id.is_quick_cutting
|
||||
self.cutting_tool_is_safety_lock = self.specification_id.is_safe_lock
|
||||
self.cutting_tool_fit_nut_model = self.specification_id.nut
|
||||
self.cutting_tool_wrench = self.specification_id.spanner
|
||||
self.cutting_tool_chuck_id = self.specification_id.chuck_id.id
|
||||
self.cutting_tool_jump_accuracy = self.specification_id.diameter_slip_accuracy
|
||||
self.cutting_tool_taper_shank_model = self.specification_id.taper_shank_model
|
||||
self.suitable_machining_method_ids = [(6, 0, [])] if not \
|
||||
self.cutting_tool_model_id.suitable_machining_method_ids \
|
||||
else [(6, 0, self.cutting_tool_model_id.suitable_machining_method_ids.ids)]
|
||||
@@ -352,12 +364,12 @@ class ResProductMo(models.Model):
|
||||
raise ValidationError("请选择压紧方式")
|
||||
if self.cutting_tool_type == '刀片':
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却液")
|
||||
raise ValidationError("请选择适合冷却方式")
|
||||
elif self.cutting_tool_type == '整体式刀具':
|
||||
if not self.handle_type_id:
|
||||
raise ValidationError("请选择柄部类型")
|
||||
if not self.suitable_coolant_ids:
|
||||
raise ValidationError("请选择适合冷却液")
|
||||
raise ValidationError("请选择适合冷却方式")
|
||||
if not self.suitable_machining_method_ids:
|
||||
raise ValidationError("请选择适合加工方式")
|
||||
if not self.blade_tip_characteristics_id:
|
||||
@@ -371,11 +383,8 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_rear_angle = fields.Integer('后角(°)')
|
||||
cutting_tool_main_included_angle = fields.Integer('主偏角(°)')
|
||||
# 适用夹头型号可以多选
|
||||
cutting_tool_chuck_ids = fields.Many2many(
|
||||
cutting_tool_chuck_id = fields.Many2one(
|
||||
'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='适用夹头型号')
|
||||
# 刀片参数
|
||||
@@ -432,11 +441,8 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_min_machining_aperture = fields.Integer('最小加工孔径(mm)')
|
||||
cutting_tool_install_blade_tip_num = fields.Integer('可装刀片数/齿数(个)', size=20)
|
||||
cutting_tool_installing_structure = fields.Char('安装结构', size=20)
|
||||
cutting_tool_blade_ids = fields.Many2many(
|
||||
cutting_tool_blade_id = fields.Many2one(
|
||||
'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='适用刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
@@ -547,12 +553,6 @@ class ResProductMo(models.Model):
|
||||
code_arr.append(i.code)
|
||||
return code_arr
|
||||
|
||||
def _json_chuck_item_code(self, item):
|
||||
code_arr = []
|
||||
for i in item.product_id.cutting_tool_chuck_ids:
|
||||
code_arr.append(i.code)
|
||||
return code_arr
|
||||
|
||||
def _json_cutter_bar_item_code(self, item):
|
||||
code_arr = []
|
||||
for i in item.product_id.cutting_tool_cutter_bar_ids:
|
||||
@@ -565,12 +565,6 @@ class ResProductMo(models.Model):
|
||||
code_arr.append(i.code)
|
||||
return code_arr
|
||||
|
||||
def _json_blade_item_code(self, item):
|
||||
code_arr = []
|
||||
for i in item.product_id.cutting_tool_blade_ids:
|
||||
code_arr.append(i.code)
|
||||
return code_arr
|
||||
|
||||
def _json_handle_item_code(self, item):
|
||||
code_arr = []
|
||||
for i in item.product_id.cutting_tool_handle_ids:
|
||||
@@ -603,7 +597,6 @@ class ResProductMo(models.Model):
|
||||
for item in self:
|
||||
if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']:
|
||||
item.brand_id = item.fixture_model_id.brand_id.id
|
||||
item.fixture_multi_mounting_type_id = item.fixture_model_id.multi_mounting_type_id.id
|
||||
item.fixture_model_file = item.fixture_model_id.model_file
|
||||
item.tool_length = item.fixture_model_id.length
|
||||
item.tool_width = item.fixture_model_id.width
|
||||
|
||||
@@ -386,8 +386,6 @@ class ReStockMove(models.Model):
|
||||
'brand_code': self.env['sf.machine.brand'].search([('id', '=', item.product_id.brand_id.id)]).code,
|
||||
'fixture_material_code': self.env['sf.fixture.material'].search(
|
||||
[('id', '=', item.product_id.fixture_material_id.id)]).code,
|
||||
'fixture_multi_mounting_type_code': self.env['sf.multi_mounting.type'].search(
|
||||
[('id', '=', item.product_id.fixture_multi_mounting_type_id.id)]).code,
|
||||
'fixture_materials_type_code': self.env['sf.materials.model'].search(
|
||||
[('id', '=', item.product_id.materials_type_id.id)]).materials_no,
|
||||
'fixture_clamping_way': item.product_id.fixture_clamping_way,
|
||||
|
||||
@@ -107,3 +107,4 @@ access_sf_cnc_processing,sf.cnc.processing,model_sf_cnc_processing,sf_base.group
|
||||
|
||||
|
||||
access_mrp_workcenter_productivity,mrp.workcenter.productivity,mrp.model_mrp_workcenter_productivity,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_maintenance_equipment_tool_group_plan_dispatch,maintenance.equipment.tool,sf_manufacturing.model_maintenance_equipment_tool,sf_base.group_plan_dispatch,1,0,0,0
|
||||
|
||||
|
@@ -2220,6 +2220,10 @@ class Cutting_tool_standard_library(models.Model):
|
||||
"fit_blade_shape_id": False if not item['fit_blade_shape'] else self.env[
|
||||
'maintenance.equipment.image'].search(
|
||||
[('name', '=', item['fit_blade_shape'])]).id,
|
||||
"chuck_id": False if not item['chuck_code'] else self.search(
|
||||
[('code', '=', item['chuck_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"handle_id": False if not item['handle_code'] else self.search(
|
||||
[('code', '=', item['handle_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
||||
item['suitable_machining_methods']),
|
||||
@@ -2258,6 +2262,10 @@ class Cutting_tool_standard_library(models.Model):
|
||||
"fit_blade_shape_id": False if not item['fit_blade_shape'] else self.env[
|
||||
'maintenance.equipment.image'].search(
|
||||
[('name', '=', item['fit_blade_shape'])]).id,
|
||||
"chuck_id": False if not item['chuck_code'] else self.search(
|
||||
[('code', '=', item['chuck_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"handle_id": False if not item['handle_code'] else self.search(
|
||||
[('code', '=', item['handle_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
||||
item['suitable_machining_methods']),
|
||||
@@ -2318,6 +2326,10 @@ class Cutting_tool_standard_library(models.Model):
|
||||
"fit_blade_shape_id": False if not item['fit_blade_shape'] else self.env[
|
||||
'maintenance.equipment.image'].search(
|
||||
[('name', '=', item['fit_blade_shape'])]).id,
|
||||
"chuck_id": False if not item['chuck_code'] else self.search(
|
||||
[('code', '=', item['chuck_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"handle_id": False if not item['handle_code'] else self.search(
|
||||
[('code', '=', item['handle_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||
'suitable_machining_method') else self.env['maintenance.equipment.image']._get_ids(
|
||||
item['suitable_machining_method']),
|
||||
@@ -2356,6 +2368,10 @@ class Cutting_tool_standard_library(models.Model):
|
||||
"fit_blade_shape_id": False if not item['fit_blade_shape'] else self.env[
|
||||
'maintenance.equipment.image'].search(
|
||||
[('name', '=', item['fit_blade_shape'])]).id,
|
||||
"chuck_id": False if not item['chuck_code'] else self.search(
|
||||
[('code', '=', item['chuck_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"handle_id": False if not item['handle_code'] else self.search(
|
||||
[('code', '=', item['handle_code'].replace("JKM", result['factory_short_name']))]).id,
|
||||
"suitable_machining_method_ids": [(6, 0, [])] if not item.get(
|
||||
'suitable_machining_methods') else self.env['maintenance.equipment.image']._get_ids(
|
||||
item['suitable_machining_methods']),
|
||||
@@ -2681,6 +2697,7 @@ class CuttingToolBasicParameters(models.Model):
|
||||
'name': knife_handle_item['name'],
|
||||
'code': knife_handle_item['code'],
|
||||
'cutting_tool_type': '刀柄',
|
||||
'taper_shank_model': knife_handle_item['taper_shank_model'],
|
||||
'standard_library_id': self.env['sf.cutting_tool.standard.library'].search(
|
||||
[('code', '=', knife_handle_item['standard_library_code'].replace("JKM", result[
|
||||
'factory_short_name']))]).id,
|
||||
@@ -2706,6 +2723,7 @@ class CuttingToolBasicParameters(models.Model):
|
||||
else:
|
||||
self.write({
|
||||
'name': knife_handle_item['name'],
|
||||
'taper_shank_model': knife_handle_item['taper_shank_model'],
|
||||
'total_length': knife_handle_item['total_length'],
|
||||
'flange_shank_length': knife_handle_item['flange_length'],
|
||||
'flange_diameter': knife_handle_item['flange_diameter'],
|
||||
@@ -3043,6 +3061,7 @@ class CuttingToolBasicParameters(models.Model):
|
||||
[('code', '=', knife_handle_item['standard_library_code'].replace("JKM", result[
|
||||
'factory_short_name']))]).id,
|
||||
'total_length': knife_handle_item['total_length'],
|
||||
'taper_shank_model': knife_handle_item['taper_shank_model'],
|
||||
'flange_shank_length': knife_handle_item['flange_length'],
|
||||
'flange_diameter': knife_handle_item['flange_diameter'],
|
||||
'shank_length': knife_handle_item['shank_length'],
|
||||
@@ -3068,6 +3087,7 @@ class CuttingToolBasicParameters(models.Model):
|
||||
self.write({
|
||||
'name': knife_handle_item['name'],
|
||||
'total_length': knife_handle_item['total_length'],
|
||||
'taper_shank_model': knife_handle_item['taper_shank_model'],
|
||||
'flange_shank_length': knife_handle_item['flange_length'],
|
||||
'flange_diameter': knife_handle_item['flange_diameter'],
|
||||
'shank_length': knife_handle_item['shank_length'],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import logging
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo import fields, models, api
|
||||
# from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
from quatotion import readSql, feature_recognize, auto_quatotion
|
||||
|
||||
__author__ = 'jinling.yang'
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -5,8 +5,8 @@ import os
|
||||
import json
|
||||
from datetime import datetime
|
||||
import requests
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
from odoo import models, fields, api
|
||||
from odoo.modules import get_resource_path
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
|
||||
@@ -118,8 +118,8 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
'maintenance.equipment.image', 'rel_cutting_product_template_tool_entity', '走刀方向',
|
||||
domain=[('type', '=', '走刀方向')])
|
||||
suitable_coolant_ids = fields.Many2many(
|
||||
'maintenance.equipment.image', 'rel_coolant_product_template_tool_entity', '适合冷却液',
|
||||
domain=[('type', '=', '冷却液')])
|
||||
'maintenance.equipment.image', 'rel_coolants_product_template_tool_entity', '适合冷却方式',
|
||||
domain=[('type', '=', '冷却方式')])
|
||||
|
||||
@api.depends('cutting_tool_integral_model_id', 'cutting_tool_blade_model_id')
|
||||
def _compute_maintenance_equipment_image(self):
|
||||
@@ -287,7 +287,7 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
'maintenance.equipment.image', 'rel_cutting_product_template_distribution', '走刀方向',
|
||||
domain=[('type', '=', '走刀方向')], related='sf_functional_cutting_tool_entity_ids.cutting_direction_ids')
|
||||
suitable_coolant_ids = fields.Many2many(
|
||||
'maintenance.equipment.image', 'rel_coolant_product_template_distribution', '适合冷却液',
|
||||
'maintenance.equipment.image', 'rel_coolant_product_template_distribution', '适合冷却方式',
|
||||
domain=[('type', '=', '冷却液')], related='sf_functional_cutting_tool_entity_ids.suitable_coolant_ids')
|
||||
|
||||
sf_functional_cutting_tool_entity_ids = fields.Many2many('sf.functional.cutting.tool.entity',
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"
|
||||
domain="[('id','in',cutting_direction_ids)]"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<group string="适合冷却方式">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"
|
||||
domain="[('id','in',suitable_coolant_ids)]"/>
|
||||
</group>
|
||||
@@ -359,7 +359,7 @@
|
||||
readonly="1"
|
||||
domain="[('id','in',cutting_direction_ids)]"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<group string="适合冷却方式">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"
|
||||
readonly="1"
|
||||
domain="[('id','in',suitable_coolant_ids)]"/>
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<group string="适合冷却方式">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user