1、新增夹具物料基本参数模型,重构工厂的夹具型号模型,重新优化夹具物料form视图;2、优化刀具标准库模型,优化切削速度模型,优化每齿走刀量模型,新增切削宽度和深度模型,新增坡铣角度模型;3、优化功能刀具安全库存最低安全库存可以高于最高库存的bug;
This commit is contained in:
@@ -26,33 +26,28 @@ class FixtureModel(models.Model):
|
||||
_name = 'sf.fixture.model'
|
||||
_description = "夹具型号"
|
||||
|
||||
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', store=True)
|
||||
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌", domain="[('tag_ids.name', 'ilike', '夹具')]")
|
||||
clamping_way = fields.Char(string="装夹方式")
|
||||
port_type = fields.Char(string="接口类型")
|
||||
name = fields.Char(string="名称", size=50, required=True)
|
||||
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)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
|
||||
model_file = fields.Binary(string="3D模型图")
|
||||
active = fields.Boolean('有效', default=False)
|
||||
|
||||
length = fields.Char(string="长度(mm)")
|
||||
width = fields.Char(string="宽度(mm)")
|
||||
height = fields.Char(string="高度(mm)")
|
||||
weight = fields.Char(string="重量(kg)")
|
||||
clamp_workpiece_length_max = fields.Integer(string="夹持工件长度max(mm)")
|
||||
clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度max(mm)")
|
||||
clamp_workpiece_height_max = fields.Integer(string="夹持工件高度max(mm)")
|
||||
clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径max(mm)")
|
||||
maximum_carrying_weight = fields.Float(string="最大承载重量(kg)")
|
||||
maximum_clamping_force = fields.Integer(string="最大夹持力(n)")
|
||||
|
||||
materials_model_id = fields.Many2one('sf.materials.model', string="材料型号")
|
||||
driving_way = fields.Selection([('气动', '气动'), ('液压', '液压'), ('机械', '机械')], string="驱动方式")
|
||||
apply_machine_tool_type_ids = fields.Many2many('sf.machine_tool.type', 'rel_fixture_model_machine_tool_type',
|
||||
string="适用机床型号")
|
||||
through_hole_size = fields.Integer(string="过孔大小[mm]")
|
||||
screw_size = fields.Integer(string="螺牙大小[mm]")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='零点卡盘基本参数')
|
||||
zero_tray_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='零点托盘基本参数')
|
||||
pneumatic_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='气动夹具基本参数')
|
||||
jaw_vice_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='虎钳夹具基本参数')
|
||||
magnet_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='磁吸夹具基本参数')
|
||||
adapter_board_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='转接板夹具基本参数')
|
||||
scroll_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='三爪卡盘基本参数')
|
||||
|
||||
def _get_code(self, fixture_model_type_code):
|
||||
fixture_model = self.env['sf.fixture.model'].sudo().search(
|
||||
@@ -70,14 +65,18 @@ class FixtureModel(models.Model):
|
||||
|
||||
def _onchange_fixture_material_id(self, fixture_material_id):
|
||||
if fixture_material_id:
|
||||
if fixture_material_id.name == "气动夹具":
|
||||
if self.fixture_material_id.name == "气动夹具":
|
||||
code = self._get_code("JKM-C-JJWL-QDJJ-")
|
||||
elif fixture_material_id.name == "转接板(锁板)夹具":
|
||||
code = self._get_code("JKM-C-JJWL-ZJBJJ-")
|
||||
elif fixture_material_id.name == "磁吸夹具":
|
||||
elif self.fixture_material_id.name == "转接板夹具":
|
||||
code = self._get_code("JKM-C-JJWL-ZJJJ-")
|
||||
elif self.fixture_material_id.name == "磁吸夹具":
|
||||
code = self._get_code("JKM-C-JJWL-CXJJ-")
|
||||
elif fixture_material_id.name == "虎钳夹具":
|
||||
elif self.fixture_material_id.name == "虎钳夹具":
|
||||
code = self._get_code("JKM-C-JJWL-HQJJ-")
|
||||
elif self.fixture_material_id.name == "零点托盘":
|
||||
code = self._get_code("JKM-C-JJWL-LDTP-")
|
||||
elif self.fixture_material_id.name == "三爪卡盘":
|
||||
code = self._get_code("JKM-C-JJWL-SZKP-")
|
||||
else:
|
||||
code = self._get_code("JKM-C-JJWL-LDKP-")
|
||||
return code
|
||||
|
||||
Reference in New Issue
Block a user