54 lines
2.6 KiB
Python
54 lines
2.6 KiB
Python
from odoo import models, fields, api
|
|
|
|
|
|
class FixtureMaterial(models.Model):
|
|
_name = 'sf.fixture.material'
|
|
_description = "夹具物料"
|
|
|
|
code = fields.Char(string='编码')
|
|
name = fields.Char(string="名称", size=15)
|
|
category = fields.Selection([('零点夹具', '零点夹具')], string="类别")
|
|
remark = fields.Char(string="备注")
|
|
active = fields.Boolean(string="有效", default=True)
|
|
|
|
|
|
class Multi_MountingType(models.Model):
|
|
_name = 'sf.multi_mounting.type'
|
|
_description = "联装类型"
|
|
|
|
code = fields.Char(string='编码')
|
|
name = fields.Char(string="名称", size=15)
|
|
remark = fields.Char(string="备注")
|
|
active = fields.Boolean(string="有效", default=True)
|
|
|
|
|
|
class FixtureModel(models.Model):
|
|
_name = 'sf.fixture.model'
|
|
_description = "夹具型号"
|
|
|
|
code = fields.Char(string='编码')
|
|
name = fields.Char(string="名称", size=15)
|
|
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", )
|
|
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name')
|
|
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
|
|
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
|
|
manufacturer_model_number = fields.Char(string="厂家型号")
|
|
clamping_way = fields.Char(string="装夹方式")
|
|
port_type = fields.Char(string="接口类型")
|
|
model_file = fields.Binary(string="3D模型图")
|
|
length = fields.Char(string="长度[mm]", size=6)
|
|
width = fields.Char(string="宽度[mm]", size=6)
|
|
height = fields.Char(string="高度[mm]", size=6)
|
|
weight = fields.Char(string="重量[kg]", size=4)
|
|
clamp_workpiece_length_max = fields.Char(string="夹持工件长度MAX[mm]", size=6)
|
|
clamp_workpiece_width_max = fields.Char(string="夹持工件宽度MAX[mm]", size=6)
|
|
clamp_workpiece_height_max = fields.Char(string="夹持工件高度MAX[mm]", size=6)
|
|
clamp_workpiece_diameter_max = fields.Char(string="夹持工件直径MAX[mm]", size=6)
|
|
maximum_carrying_weight = fields.Char(string="最大承载重量[kg]", size=4)
|
|
maximum_clamping_force = fields.Char(string="最大夹持力[n]", size=8)
|
|
materials_model_id = fields.Many2one('sf.materials.model', string="材料型号")
|
|
driving_way = fields.Char(string="驱动方式")
|
|
apply_machine_tool_type_id = fields.Many2one('sf.machine_tool.type', string="适用机床型号")
|
|
through_hole_size = fields.Integer(string="过孔大小[mm]", size=6)
|
|
screw_size = fields.Integer(string="螺牙大小[mm]", size=6)
|