Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug
# Conflicts: # sf_manufacturing/models/product_template.py
This commit is contained in:
@@ -201,7 +201,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
|
||||
@@ -227,14 +226,12 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
||||
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
||||
self.cutting_tool_chip_breaker_groove = self.specification_id.chip_breaker_groove
|
||||
# self.cutting_tool_cut_depth_max = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_chip_breaker_type_code = self.specification_id.chip_breaker_type_code
|
||||
self.cutting_tool_blade_blade_number = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_blade_width = self.specification_id.blade_width
|
||||
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
|
||||
@@ -256,15 +253,12 @@ class ResProductMo(models.Model):
|
||||
self.cutting_tool_inscribed_circle_tolerance = self.specification_id.inscribed_circle_tolerance
|
||||
self.cutting_tool_install_aperture_diameter = self.specification_id.install_aperture_diameter
|
||||
self.cutting_tool_chip_breaker_groove = self.specification_id.chip_breaker_groove
|
||||
# self.cutting_tool_cut_depth_max = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_chip_breaker_type_code = self.specification_id.chip_breaker_type_code
|
||||
self.cutting_tool_blade_blade_number = self.specification_id.blade_blade_number
|
||||
self.cutting_tool_blade_width = self.specification_id.blade_width
|
||||
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.id
|
||||
@@ -273,7 +267,6 @@ class ResProductMo(models.Model):
|
||||
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
|
||||
@@ -282,17 +275,27 @@ 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_standard_speed = self.specification_id.standard_rotate_speed
|
||||
self.cutting_tool_speed_max = self.specification_id.max_rotate_speed
|
||||
self.cutting_tool_change_time = self.specification_id.tool_changing_time
|
||||
self.cutting_tool_total_length = self.specification_id.total_length
|
||||
self.cutting_tool_clamping_diameter_max = self.specification_id.max_clamping_diameter
|
||||
self.cutting_tool_clamping_diameter_min = self.specification_id.min_clamping_diameter
|
||||
self.cutting_tool_flange_length = self.specification_id.flange_shank_length
|
||||
self.cutting_tool_shank_outer_diameter = self.specification_id.handle_external_diameter
|
||||
self.cutting_tool_shank_inner_diameter = self.specification_id.handle_inside_diameter
|
||||
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)]
|
||||
@@ -360,12 +363,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:
|
||||
@@ -379,11 +382,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='适用夹头型号')
|
||||
# 刀片参数
|
||||
@@ -394,6 +394,7 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_install_aperture_diameter = fields.Float('安装孔直径(mm)')
|
||||
cutting_tool_chip_breaker_groove = fields.Selection([('无', '无'), ('单面', '单面'), ('双面', '双面')],
|
||||
string='有无断屑槽')
|
||||
cutting_tool_chip_breaker_type_code = fields.Char('断屑槽型代号')
|
||||
cutting_tool_bladed_teeth_model = fields.Selection(
|
||||
[('无', '无'), ('V牙型', 'V牙型'), ('米制全牙型', '米制全牙型'), ('美制全牙型', '美制全牙型'),
|
||||
('惠氏全牙型', '惠氏全牙型'), ('BSPT全牙型', 'BSPT全牙型'), ('NPT全牙型', 'NPT全牙型'),
|
||||
@@ -405,8 +406,6 @@ class ResProductMo(models.Model):
|
||||
('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.Float('每英寸螺纹数(tpi)')
|
||||
@@ -441,11 +440,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='适用刀片型号' # 使用空列表作为默认值
|
||||
)
|
||||
@@ -461,24 +457,22 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_interface_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('最大夹持直径')
|
||||
cutting_tool_clamping_diameter_min = fields.Float('最小夹持直径')
|
||||
cutting_tool_flange_length = fields.Float('法兰柄长(mm)')
|
||||
cutting_tool_flange_diameter = fields.Float('法兰直径(mm)')
|
||||
cutting_tool_is_rough_finish = fields.Boolean('可粗加工', default=False)
|
||||
cutting_tool_is_finish = fields.Boolean('可精加工', default=False)
|
||||
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_change_time = fields.Integer('换刀时间(s)')
|
||||
cutting_tool_clamping_way = fields.Char('夹持方式')
|
||||
cutting_tool_fit_chuck_size = fields.Char('适配夹头尺寸')
|
||||
cutting_tool_taper_shank_model = 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_dynamic_balance_class = fields.Char('动平衡等级')
|
||||
cutting_tool_fit_nut_model = fields.Char('适用锁紧螺母型号')
|
||||
|
||||
# 夹头参数
|
||||
cutting_tool_taper = fields.Integer('锥度(°)')
|
||||
cutting_tool_top_diameter = fields.Float('顶部直径')
|
||||
@@ -486,7 +480,7 @@ class ResProductMo(models.Model):
|
||||
cutting_tool_inner_diameter = fields.Float('内径(mm)')
|
||||
cooling_suit_type_ids = fields.Char('适用冷却套型号')
|
||||
cutting_tool_max_load_capacity = fields.Float('最大负载能力(kg)')
|
||||
cutting_tool_er_size_model = fields.Char('ER尺寸型号')
|
||||
cutting_tool_er_size_model = fields.Char('尺寸型号')
|
||||
cutting_tool_handle_ids = fields.Many2many(
|
||||
'sf.cutting_tool.standard.library',
|
||||
relation='product_cutting_tool_library_chuck_handle_rel',
|
||||
@@ -496,28 +490,6 @@ class ResProductMo(models.Model):
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
|
||||
# 夹具参数
|
||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料")
|
||||
fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号")
|
||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name')
|
||||
fixture_multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
|
||||
fixture_clamping_way = fields.Char(string="装夹方式")
|
||||
fixture_port_type = fields.Char(string="接口类型")
|
||||
fixture_model_file = fields.Binary(string="3D模型图")
|
||||
|
||||
fixture_clamp_workpiece_length_max = fields.Integer(string="夹持工件长度max(mm)")
|
||||
fixture_clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度max(mm)")
|
||||
fixture_clamp_workpiece_height_max = fields.Integer(string="夹持工件高度max(mm)")
|
||||
fixture_clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径max(mm)", digits=(16, 6))
|
||||
|
||||
fixture_maximum_carrying_weight = fields.Float(string="最大承载重量(kg)", digits=(16, 4))
|
||||
fixture_maximum_clamping_force = fields.Integer(string="最大夹持力(n)")
|
||||
fixture_driving_way = fields.Char(string="驱动方式")
|
||||
fixture_apply_machine_tool_type_ids = fields.Many2many('sf.machine_tool.type', 'rel_product_machine_tool_type',
|
||||
string="适用机床型号")
|
||||
fixture_through_hole_size = fields.Integer(string="过孔大小(mm)")
|
||||
fixture_screw_size = fields.Integer(string="螺牙大小(mm)")
|
||||
|
||||
# 注册状态
|
||||
register_state = fields.Selection([('未注册', '未注册'), ('已注册', '已注册'), ('注册失败', '注册失败')],
|
||||
string='注册状态', default='未注册')
|
||||
@@ -579,12 +551,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:
|
||||
@@ -597,12 +563,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:
|
||||
@@ -630,35 +590,65 @@ class ResProductMo(models.Model):
|
||||
if item.fixture_material_id.id != item.fixture_model_id.fixture_material_id.id:
|
||||
item.fixture_model_id = False
|
||||
|
||||
@api.onchange('fixture_model_id')
|
||||
def _onchange_fixture_model_id(self):
|
||||
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
|
||||
item.tool_height = item.fixture_model_id.height
|
||||
item.tool_weight = item.fixture_model_id.weight
|
||||
item.materials_type_id = item.fixture_model_id.materials_model_id.id
|
||||
item.fixture_maximum_carrying_weight = item.fixture_model_id.maximum_carrying_weight
|
||||
item.fixture_maximum_clamping_force = item.fixture_model_id.maximum_clamping_force
|
||||
if self.fixture_material_type in ['零点卡盘', '转接板(锁板)夹具']:
|
||||
item.fixture_clamping_way = item.fixture_model_id.clamping_way
|
||||
item.fixture_port_type = item.fixture_model_id.port_type
|
||||
if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具']:
|
||||
item.fixture_driving_way = item.fixture_model_id.driving_way
|
||||
if self.fixture_material_type in ['气动夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']:
|
||||
item.fixture_through_hole_size = item.fixture_model_id.through_hole_size
|
||||
item.fixture_screw_size = item.fixture_model_id.screw_size
|
||||
if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具']:
|
||||
item.fixture_clamp_workpiece_length_max = item.fixture_model_id.clamp_workpiece_length_max
|
||||
item.fixture_clamp_workpiece_width_max = item.fixture_model_id.clamp_workpiece_width_max
|
||||
item.fixture_clamp_workpiece_height_max = item.fixture_model_id.clamp_workpiece_height_max
|
||||
item.fixture_clamp_workpiece_diameter_max = item.fixture_model_id.clamp_workpiece_diameter_max
|
||||
item.fixture_apply_machine_tool_type_ids = self._get_ids(
|
||||
item.fixture_model_id.apply_machine_tool_type_ids)
|
||||
#
|
||||
# @api.onchange('fixture_model_id')
|
||||
# def _onchange_fixture_model_id(self):
|
||||
# for item in self:
|
||||
# if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']:
|
||||
# item.brand_id = item.fixture_model_id.brand_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
|
||||
# item.tool_height = item.fixture_model_id.height
|
||||
# item.tool_weight = item.fixture_model_id.weight
|
||||
# item.materials_type_id = item.fixture_model_id.materials_model_id.id
|
||||
# item.fixture_maximum_carrying_weight = item.fixture_model_id.maximum_carrying_weight
|
||||
# item.fixture_maximum_clamping_force = item.fixture_model_id.maximum_clamping_force
|
||||
# if self.fixture_material_type in ['零点卡盘', '转接板(锁板)夹具']:
|
||||
# item.fixture_clamping_way = item.fixture_model_id.clamping_way
|
||||
# item.fixture_port_type = item.fixture_model_id.port_type
|
||||
# if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具']:
|
||||
# item.fixture_driving_way = item.fixture_model_id.driving_way
|
||||
# if self.fixture_material_type in ['气动夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']:
|
||||
# item.fixture_through_hole_size = item.fixture_model_id.through_hole_size
|
||||
# item.fixture_screw_size = item.fixture_model_id.screw_size
|
||||
# if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具']:
|
||||
# item.fixture_clamp_workpiece_length_max = item.fixture_model_id.clamp_workpiece_length_max
|
||||
# item.fixture_clamp_workpiece_width_max = item.fixture_model_id.clamp_workpiece_width_max
|
||||
# item.fixture_clamp_workpiece_height_max = item.fixture_model_id.clamp_workpiece_height_max
|
||||
# item.fixture_clamp_workpiece_diameter_max = item.fixture_model_id.clamp_workpiece_diameter_max
|
||||
# item.fixture_apply_machine_tool_type_ids = self._get_ids(
|
||||
# item.fixture_model_id.apply_machine_tool_type_ids)
|
||||
|
||||
# @api.onchange('fixture_model_id')
|
||||
# def _onchange_fixture_model_id(self):
|
||||
# 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
|
||||
# item.tool_height = item.fixture_model_id.height
|
||||
# item.tool_weight = item.fixture_model_id.weight
|
||||
# item.materials_type_id = item.fixture_model_id.materials_model_id.id
|
||||
# item.fixture_maximum_carrying_weight = item.fixture_model_id.maximum_carrying_weight
|
||||
# item.fixture_maximum_clamping_force = item.fixture_model_id.maximum_clamping_force
|
||||
# if self.fixture_material_type in ['零点卡盘', '转接板(锁板)夹具']:
|
||||
# item.fixture_clamping_way = item.fixture_model_id.clamping_way
|
||||
# item.fixture_port_type = item.fixture_model_id.port_type
|
||||
# if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具']:
|
||||
# item.fixture_driving_way = item.fixture_model_id.driving_way
|
||||
# if self.fixture_material_type in ['气动夹具', '磁吸夹具', '虎钳夹具', '零点卡盘']:
|
||||
# item.fixture_through_hole_size = item.fixture_model_id.through_hole_size
|
||||
# item.fixture_screw_size = item.fixture_model_id.screw_size
|
||||
# if self.fixture_material_type in ['气动夹具', '转接板(锁板)夹具', '磁吸夹具', '虎钳夹具']:
|
||||
# item.fixture_clamp_workpiece_length_max = item.fixture_model_id.clamp_workpiece_length_max
|
||||
# item.fixture_clamp_workpiece_width_max = item.fixture_model_id.clamp_workpiece_width_max
|
||||
# item.fixture_clamp_workpiece_height_max = item.fixture_model_id.clamp_workpiece_height_max
|
||||
# item.fixture_clamp_workpiece_diameter_max = item.fixture_model_id.clamp_workpiece_diameter_max
|
||||
# item.fixture_apply_machine_tool_type_ids = self._get_ids(
|
||||
# item.fixture_model_id.apply_machine_tool_type_ids)
|
||||
|
||||
def _get_volume_uom_id_from_ir_config_parameter(self):
|
||||
product_length_in_feet_param = self.env['ir.config_parameter'].sudo().get_param('product.volume_in_cubic_feet')
|
||||
@@ -836,6 +826,145 @@ class ResProductMo(models.Model):
|
||||
return base64_data
|
||||
|
||||
|
||||
class ResProductFixture(models.Model):
|
||||
_inherit = 'product.template'
|
||||
_description = '夹具产品信息'
|
||||
|
||||
fixture_model_id = fields.Many2one('sf.fixture.model', '夹具型号')
|
||||
specification_fixture_id = fields.Many2one('sf.fixture.materials.basic.parameters', '夹具规格')
|
||||
|
||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", required=True)
|
||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name')
|
||||
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型", required=True)
|
||||
model_file = fields.Binary(string="3D模型图")
|
||||
|
||||
# 夹具物料基本参数
|
||||
# length = fields.Float('长度(mm)', digits=(16, 2))
|
||||
# width = fields.Float('宽度(mm)', digits=(16, 2))
|
||||
# height = fields.Float('高度(mm)', digits=(16, 2))
|
||||
diameter = fields.Float('直径(mm)', digits=(16, 2))
|
||||
|
||||
# '零点卡盘' 字段
|
||||
weight = fields.Float('重量(mm)', digits=(16, 2))
|
||||
orientation_dish_diameter = fields.Float('定位盘直径(mm)', digits=(16, 2))
|
||||
clamping_diameter = fields.Float('装夹直径(mm)', digits=(16, 2))
|
||||
clamping_num = fields.Selection([('1', '1'), ('2', '2'), ('4', '4'), ('6', '6'), ('8', '8')], string='装夹单元数')
|
||||
chucking_power_max = fields.Float('最大夹持力(KN)', digits=(16, 2))
|
||||
repeated_positioning_accuracy = fields.Char('重复定位精度(mm)', size=20)
|
||||
boolean_transposing_hole = fields.Boolean('是否有转位孔')
|
||||
unlocking_method = fields.Selection(
|
||||
[('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')], string='解锁方式')
|
||||
boolean_chip_blowing_function = fields.Boolean('是否有吹屑功能')
|
||||
carrying_capacity_max = fields.Float('最大承载重量(kg)', digits=(16, 2))
|
||||
rigidity = fields.Integer('硬度HRC')
|
||||
materials_model_id = fields.Many2one('sf.materials.model', '夹具材质')
|
||||
machine_tool_type_id = fields.Many2one('sf.machine_tool.type', '适用机床型号')
|
||||
|
||||
# ’零点托盘‘ 字段
|
||||
connector_diameter = fields.Selection([('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('8', '8')],
|
||||
string='连接头直径(mm)')
|
||||
way_to_install = fields.Selection(
|
||||
[('接口式', '接口式'), ('螺栓固定', '螺栓固定'), ('磁吸式', '磁吸式'), ('其他', '其他')], string='安装方式')
|
||||
type_of_drive = fields.Selection(
|
||||
[('气动式', '气动式'), ('液压式', '液压式'), ('机械式', '机械式'), ('电动式', '电动式'), ('其他', '其他')],
|
||||
string='驱动方式')
|
||||
|
||||
# ’气动夹具‘ 字段
|
||||
gripper_length_min = fields.Float('夹持工件最小长度(mm)', digits=(16, 2))
|
||||
gripper_width_min = fields.Float('夹持工件最小宽度(mm)', digits=(16, 2))
|
||||
gripper_height_min = fields.Float('夹持工件最小高度(mm)', digits=(16, 2))
|
||||
gripper_diameter_min = fields.Float('夹持工件最小直径(mm)', digits=(16, 2))
|
||||
gripper_length_max = fields.Float('夹持工件最大长度(mm)', digits=(16, 2))
|
||||
gripper_width_max = fields.Float('夹持工件最大宽度(mm)', digits=(16, 2))
|
||||
gripper_height_max = fields.Float('夹持工件最大高度(mm)', digits=(16, 2))
|
||||
gripper_diameter_max = fields.Float('夹持工件最大直径(mm)', digits=(16, 2))
|
||||
rated_air_pressure = fields.Float('额定气压(Mpa)', digits=(16, 2))
|
||||
interface_materials_model_id = fields.Many2one('sf.materials.model', '接口类型')
|
||||
|
||||
# ‘虎钳夹具' 字段
|
||||
transverse_groove = fields.Float('横向配合槽n(mm)', digits=(16, 2))
|
||||
longitudinal_fitting_groove = fields.Float('纵向配合槽l(mm)', digits=(16, 2))
|
||||
|
||||
# '磁吸夹具' 字段
|
||||
height_tolerance_value = fields.Char('高度公差(mm)')
|
||||
rated_adsorption_force = fields.Float('额定吸附力(N/cm²)', digits=(16, 2))
|
||||
magnetic_field_height = fields.Float('磁场高度(mm)', digits=(16, 2))
|
||||
magnetic_pole_plate_grinding_allowance = fields.Float('磁极板磨削余量(mm)', digits=(16, 2))
|
||||
|
||||
# '转接板(锁板)夹具' 字段
|
||||
screw_size = fields.Float('螺牙大小(mm)', digits=(16, 2))
|
||||
via_hole_diameter = fields.Float('过孔直径(mm)', digits=(16, 2))
|
||||
|
||||
# '三爪卡盘' 字段
|
||||
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||
centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2))
|
||||
|
||||
# =========================待删除字段================================
|
||||
fixture_multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
|
||||
fixture_clamping_way = fields.Char(string="装夹方式")
|
||||
fixture_port_type = fields.Char(string="接口类型")
|
||||
fixture_model_file = fields.Binary(string="3D模型图")
|
||||
|
||||
fixture_clamp_workpiece_length_max = fields.Integer(string="夹持工件长度max(mm)")
|
||||
fixture_clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度max(mm)")
|
||||
fixture_clamp_workpiece_height_max = fields.Integer(string="夹持工件高度max(mm)")
|
||||
fixture_clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径max(mm)", digits=(16, 6))
|
||||
|
||||
fixture_maximum_carrying_weight = fields.Float(string="最大承载重量(kg)", digits=(16, 4))
|
||||
fixture_maximum_clamping_force = fields.Integer(string="最大夹持力(n)")
|
||||
fixture_driving_way = fields.Char(string="驱动方式")
|
||||
fixture_apply_machine_tool_type_ids = fields.Many2many('sf.machine_tool.type', 'rel_product_machine_tool_type',
|
||||
string="适用机床型号")
|
||||
fixture_through_hole_size = fields.Integer(string="过孔大小(mm)")
|
||||
fixture_screw_size = fields.Integer(string="螺牙大小(mm)")
|
||||
|
||||
# ===============================================================
|
||||
|
||||
@api.onchange('specification_fixture_id')
|
||||
def _onchange_specification_fixture_id(self):
|
||||
if self.specification_fixture_id:
|
||||
self.length = self.specification_fixture_id.length
|
||||
self.width = self.specification_fixture_id.width
|
||||
self.height = self.specification_fixture_id.height
|
||||
self.weight = self.specification_fixture_id.weight
|
||||
self.diameter = self.specification_fixture_id.diameter
|
||||
self.orientation_dish_diameter = self.specification_fixture_id.orientation_dish_diameter
|
||||
self.clamping_diameter = self.specification_fixture_id.clamping_diameter
|
||||
self.clamping_num = self.specification_fixture_id.clamping_num
|
||||
self.chucking_power_max = self.specification_fixture_id.chucking_power_max
|
||||
self.repeated_positioning_accuracy = self.specification_fixture_id.repeated_positioning_accuracy
|
||||
self.boolean_transposing_hole = self.specification_fixture_id.boolean_transposing_hole
|
||||
self.unlocking_method = self.specification_fixture_id.unlocking_method
|
||||
self.boolean_chip_blowing_function = self.specification_fixture_id.boolean_chip_blowing_function
|
||||
self.carrying_capacity_max = self.specification_fixture_id.carrying_capacity_max
|
||||
self.rigidity = self.specification_fixture_id.rigidity
|
||||
self.materials_model_id = self.specification_fixture_id.materials_model_id
|
||||
self.machine_tool_type_id = self.specification_fixture_id.machine_tool_type_id
|
||||
self.connector_diameter = self.specification_fixture_id.connector_diameter
|
||||
self.way_to_install = self.specification_fixture_id.way_to_install
|
||||
self.type_of_drive = self.specification_fixture_id.type_of_drive
|
||||
self.gripper_length_min = self.specification_fixture_id.gripper_length_min
|
||||
self.gripper_width_min = self.specification_fixture_id.gripper_width_min
|
||||
self.gripper_height_min = self.specification_fixture_id.gripper_height_min
|
||||
self.gripper_diameter_min = self.specification_fixture_id.gripper_diameter_min
|
||||
self.gripper_length_max = self.specification_fixture_id.gripper_length_max
|
||||
self.gripper_width_max = self.specification_fixture_id.gripper_width_max
|
||||
self.gripper_height_max = self.specification_fixture_id.gripper_height_max
|
||||
self.gripper_diameter_max = self.specification_fixture_id.gripper_diameter_max
|
||||
self.rated_air_pressure = self.specification_fixture_id.rated_air_pressure
|
||||
self.interface_materials_model_id = self.specification_fixture_id.interface_materials_model_id
|
||||
self.transverse_groove = self.specification_fixture_id.transverse_groove
|
||||
self.longitudinal_fitting_groove = self.specification_fixture_id.longitudinal_fitting_groove
|
||||
self.height_tolerance_value = self.specification_fixture_id.height_tolerance_value
|
||||
self.rated_adsorption_force = self.specification_fixture_id.rated_adsorption_force
|
||||
self.magnetic_field_height = self.specification_fixture_id.magnetic_field_height
|
||||
self.magnetic_pole_plate_grinding_allowance = self.specification_fixture_id.magnetic_pole_plate_grinding_allowance
|
||||
self.screw_size = self.specification_fixture_id.screw_size
|
||||
self.via_hole_diameter = self.specification_fixture_id.via_hole_diameter
|
||||
self.mounting_hole_depth = self.specification_fixture_id.mounting_hole_depth
|
||||
self.centering_diameter = self.specification_fixture_id.centering_diameter
|
||||
|
||||
|
||||
class SfMaintenanceEquipmentAndProductTemplate(models.Model):
|
||||
_inherit = 'maintenance.equipment'
|
||||
_description = '设备'
|
||||
|
||||
Reference in New Issue
Block a user