Accept Merge Request #768: (feature/夹具型号同步优化 -> develop)
Merge Request: 功能刀具优化,夹具型号同步功能优化 Created By: @禹翔辉 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @禹翔辉 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/768
This commit is contained in:
@@ -48,7 +48,7 @@ class MachineBrand(models.Model):
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
#机床
|
||||
# 机床
|
||||
class MachineTool(models.Model):
|
||||
_name = 'sf.machine_tool'
|
||||
_description = '机床'
|
||||
@@ -92,7 +92,8 @@ class MachineTool(models.Model):
|
||||
type_id = fields.Many2one('sf.machine_tool.type', '型号')
|
||||
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||
state = fields.Selection(
|
||||
[("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"),("空闲", "空闲"),("封存(报废)", "封存(报废)")],
|
||||
[("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"), ("空闲", "空闲"),
|
||||
("封存(报废)", "封存(报废)")],
|
||||
default='正常', string="机床状态")
|
||||
# 0606新增字段
|
||||
machine_tool_picture = fields.Binary('图片')
|
||||
@@ -357,8 +358,7 @@ class MachineToolType(models.Model):
|
||||
lq_image_id = fields.Many2many('maintenance.equipment.image', 'lq_equipment_id', string='冷却方式',
|
||||
domain="[('type', '=', '冷却方式')]")
|
||||
|
||||
|
||||
#待删除字段
|
||||
# 待删除字段
|
||||
precision_min = fields.Float('X轴定位精度min(mm)', digits=(12, 3))
|
||||
precision_max = fields.Float('X轴定位精度max(mm)', digits=(12, 3))
|
||||
lead_screw = fields.Char('丝杆')
|
||||
|
||||
@@ -85,8 +85,10 @@ class BasicParametersFixture(models.Model):
|
||||
'boolean_chip_blowing_function': obj['boolean_chip_blowing_function'],
|
||||
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||
'rigidity': obj['rigidity'],
|
||||
'materials_model_id': obj['materials_model_id'],
|
||||
'machine_tool_type_id': obj['machine_tool_type_id'],
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'machine_tool_type_id': self.env['sf.machine_tool.type'].sudo().search(
|
||||
[('code', '=', obj['machine_tool_type_id']), ('active', '=', True)]).id,
|
||||
})
|
||||
return zero_chuck_param_str
|
||||
|
||||
@@ -106,7 +108,8 @@ class BasicParametersFixture(models.Model):
|
||||
'way_to_install': obj['way_to_install'],
|
||||
'type_of_drive': obj['type_of_drive'],
|
||||
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||
'materials_model_id': obj['materials_model_id'],
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'rigidity': obj['rigidity'],
|
||||
})
|
||||
return zero_tray_param_str
|
||||
@@ -129,9 +132,11 @@ class BasicParametersFixture(models.Model):
|
||||
'chucking_power_max': obj['chucking_power_max'],
|
||||
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||
'rated_air_pressure': obj['rated_air_pressure'],
|
||||
'materials_model_id': obj['materials_model_id'],
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'rigidity': obj['rigidity'],
|
||||
'interface_materials_model_id': obj['interface_materials_model_id'],
|
||||
'interface_materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'type_of_drive': obj['type_of_drive'],
|
||||
})
|
||||
return pneumatic_fixture_param_str
|
||||
@@ -155,9 +160,11 @@ class BasicParametersFixture(models.Model):
|
||||
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||
'transverse_groove': obj['transverse_groove'],
|
||||
'longitudinal_fitting_groove': obj['longitudinal_fitting_groove'],
|
||||
'materials_model_id': obj['materials_model_id'],
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'rigidity': obj['rigidity'],
|
||||
'interface_materials_model_id': obj['interface_materials_model_id'],
|
||||
'interface_materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'type_of_drive': obj['type_of_drive'],
|
||||
})
|
||||
return jaw_vice_fixture_param_str
|
||||
@@ -182,9 +189,11 @@ class BasicParametersFixture(models.Model):
|
||||
'magnetic_field_height': obj['magnetic_field_height'],
|
||||
'magnetic_pole_plate_grinding_allowance': obj['magnetic_pole_plate_grinding_allowance'],
|
||||
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||
'materials_model_id': obj['materials_model_id'],
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'rigidity': obj['rigidity'],
|
||||
'interface_materials_model_id': obj['interface_materials_model_id'],
|
||||
'interface_materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'type_of_drive': obj['type_of_drive'],
|
||||
})
|
||||
return magnet_fixture_param_str
|
||||
@@ -206,7 +215,8 @@ class BasicParametersFixture(models.Model):
|
||||
'gripper_diameter_max': obj['gripper_diameter_max'],
|
||||
'chucking_power_max': obj['chucking_power_max'],
|
||||
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||
'materials_model_id': obj['materials_model_id'],
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'rigidity': obj['rigidity'],
|
||||
'screw_size': obj['screw_size'],
|
||||
'via_hole_diameter': obj['via_hole_diameter'],
|
||||
@@ -232,7 +242,8 @@ class BasicParametersFixture(models.Model):
|
||||
'gripper_diameter_max': obj['gripper_diameter_max'],
|
||||
'chucking_power_max': obj['chucking_power_max'],
|
||||
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||
'materials_model_id': obj['materials_model_id'],
|
||||
'materials_model_id': self.env['sf.materials.model'].sudo().search(
|
||||
[('materials_no', '=', obj['materials_model_id']), ('active', '=', True)]).id,
|
||||
'rigidity': obj['rigidity'],
|
||||
'mounting_hole_depth': obj['mounting_hole_depth'],
|
||||
'centering_diameter': obj['centering_diameter'],
|
||||
|
||||
@@ -31,7 +31,7 @@ class FixtureModel(models.Model):
|
||||
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模型图")
|
||||
model_file = fields.Binary(string="图片")
|
||||
status = fields.Boolean('状态')
|
||||
active = fields.Boolean('有效', default=False)
|
||||
|
||||
@@ -49,43 +49,42 @@ class FixtureModel(models.Model):
|
||||
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(
|
||||
[('code', 'ilike', fixture_model_type_code)],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not fixture_model:
|
||||
num = "%03d" % 1
|
||||
else:
|
||||
m = int(fixture_model.code[-3:]) + 1
|
||||
num = "%03d" % m
|
||||
return "%s%s" % (fixture_model_type_code, num)
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
|
||||
def _onchange_fixture_material_id(self, fixture_material_id):
|
||||
if fixture_material_id:
|
||||
if self.fixture_material_id.name == "气动夹具":
|
||||
code = self._get_code("JKM-C-JJWL-QDJJ-")
|
||||
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 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
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals):
|
||||
obj = super(FixtureModel, self).create(vals)
|
||||
if obj.fixture_material_id:
|
||||
code = self._onchange_fixture_material_id(obj.fixture_material_id)
|
||||
obj.code = code
|
||||
return obj
|
||||
# def _get_code(self, fixture_model_type_code):
|
||||
# fixture_model = self.env['sf.fixture.model'].sudo().search(
|
||||
# [('code', 'ilike', fixture_model_type_code)],
|
||||
# limit=1,
|
||||
# order="id desc")
|
||||
# if not fixture_model:
|
||||
# num = "%03d" % 1
|
||||
# else:
|
||||
# m = int(fixture_model.code[-3:]) + 1
|
||||
# num = "%03d" % m
|
||||
# return "%s%s" % (fixture_model_type_code, num)
|
||||
#
|
||||
# def _onchange_fixture_material_id(self, fixture_material_id):
|
||||
# if fixture_material_id:
|
||||
# if self.fixture_material_id.name == "气动夹具":
|
||||
# code = self._get_code("JKM-C-JJWL-QDJJ-")
|
||||
# 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 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
|
||||
#
|
||||
# @api.model_create_multi
|
||||
# def create(self, vals):
|
||||
# obj = super(FixtureModel, self).create(vals)
|
||||
# if obj.fixture_material_id:
|
||||
# code = self._onchange_fixture_material_id(obj.fixture_material_id)
|
||||
# obj.code = code
|
||||
# return obj
|
||||
|
||||
@@ -32,30 +32,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="sf_fixture_material_view_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">夹具物料</field>-->
|
||||
<!-- <field name="model">sf.fixture.material</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="夹具物料">-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group string="基本信息">-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="code"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="name"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <!– <group>–>-->
|
||||
<!-- <field name="remark"/>-->
|
||||
<!-- <!– </group>–>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="sf_fixture_material_view_act" model="ir.actions.act_window">
|
||||
<field name="name">夹具物料</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
@@ -96,28 +72,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="sf_multi_mounting_type_view_form" model="ir.ui.view">-->
|
||||
<!-- <field name="name">联装类型</field>-->
|
||||
<!-- <field name="model">sf.multi_mounting.type</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="联装类型">-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group string="基本信息">-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="code"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="name"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="remark"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record id="sf_multi_mounting_type_view_act" model="ir.actions.act_window">
|
||||
<field name="name">联装类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
||||
@@ -509,7 +509,7 @@
|
||||
<field name="name">刀具组</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.tool.groups</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
<!-- ================================================刀具基础参数================================================ -->
|
||||
|
||||
@@ -1465,7 +1465,7 @@ class SyncFixtureModel(models.Model):
|
||||
if result.get('fixture_model_yesterday_list'):
|
||||
for item in result['fixture_model_yesterday_list']:
|
||||
if item:
|
||||
fixture_model = self.search([("code", '=', item['code'])])
|
||||
fixture_model = self.search([("code", '=', item['code']), ('active', 'in', [True, False])])
|
||||
zero_chuck_list = []
|
||||
for zero_chuck_id in item['zero_chuck_ids']:
|
||||
zero_chuck_list.append(
|
||||
@@ -1520,6 +1520,17 @@ class SyncFixtureModel(models.Model):
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
fixture_model.write({
|
||||
"zero_chuck_ids": [(5, 0, 0)],
|
||||
"zero_tray_ids": [(5, 0, 0)],
|
||||
"pneumatic_fixture_ids": [(5, 0, 0)],
|
||||
"jaw_vice_fixture_ids": [(5, 0, 0)],
|
||||
"magnet_fixture_ids": [(5, 0, 0)],
|
||||
"adapter_board_fixture_ids": [(5, 0, 0)],
|
||||
"scroll_chuck_ids": [(5, 0, 0)],
|
||||
})
|
||||
self.env['sf.fixture.materials.basic.parameters'].sudo().search(
|
||||
[('fixture_model_id', '=', False)]).unlink()
|
||||
fixture_model.write({
|
||||
"name": item['name'],
|
||||
"code": item['code'],
|
||||
@@ -1555,7 +1566,7 @@ class SyncFixtureModel(models.Model):
|
||||
if result.get('fixture_model_all_list'):
|
||||
for item in result['fixture_model_all_list']:
|
||||
if item:
|
||||
fixture_model = self.search([("code", '=', item['code'])])
|
||||
fixture_model = self.search([('code', '=', item['code']), ('active', 'in', [True, False])])
|
||||
zero_chuck_list = []
|
||||
for zero_chuck_id in item['zero_chuck_ids']:
|
||||
zero_chuck_list.append(
|
||||
@@ -1610,6 +1621,17 @@ class SyncFixtureModel(models.Model):
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
fixture_model.write({
|
||||
"zero_chuck_ids": [(5, 0, 0)],
|
||||
"zero_tray_ids": [(5, 0, 0)],
|
||||
"pneumatic_fixture_ids": [(5, 0, 0)],
|
||||
"jaw_vice_fixture_ids": [(5, 0, 0)],
|
||||
"magnet_fixture_ids": [(5, 0, 0)],
|
||||
"adapter_board_fixture_ids": [(5, 0, 0)],
|
||||
"scroll_chuck_ids": [(5, 0, 0)],
|
||||
})
|
||||
self.env['sf.fixture.materials.basic.parameters'].sudo().search(
|
||||
[('fixture_model_id', '=', False)]).unlink()
|
||||
fixture_model.write({
|
||||
"name": item['name'],
|
||||
"code": item['code'],
|
||||
|
||||
@@ -23,7 +23,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)', readonly=True)
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=True)
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=True)
|
||||
tool_loading_length = fields.Float(strin='总长度(mm)', readonly=True)
|
||||
tool_loading_length = fields.Float(string='总长度(mm)', readonly=True)
|
||||
functional_tool_length = fields.Float(string='伸出长(mm)', readonly=True)
|
||||
effective_length = fields.Float(string='有效长(mm)', readonly=True)
|
||||
tool_room_num = fields.Integer(string='刀具房数量', readonly=True)
|
||||
@@ -108,7 +108,7 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
|
||||
suitable_machining_method_ids = fields.Many2many(
|
||||
'maintenance.equipment.image', 'rel_machining_product_template_tool_entity', '适合加工方式',
|
||||
domain=[('type', '=', '加工能力')])
|
||||
domain=[('type', '=', '加工能力')], compute='_compute_maintenance_equipment_image')
|
||||
blade_tip_characteristics_id = fields.Many2one(
|
||||
'maintenance.equipment.image', '刀尖特征',
|
||||
domain=[('type', '=', '刀尖特征')])
|
||||
@@ -125,22 +125,25 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
@api.depends('cutting_tool_integral_model_id', 'cutting_tool_blade_model_id')
|
||||
def _compute_maintenance_equipment_image(self):
|
||||
for record in self:
|
||||
print('111')
|
||||
if record.cutting_tool_integral_model_id:
|
||||
print(record.cutting_tool_integral_model_id)
|
||||
record.suitable_machining_method_ids = record.cutting_tool_integral_model_id.suitable_machining_method_ids.ids
|
||||
record.blade_tip_characteristics_id = record.cutting_tool_integral_model_id.blade_tip_characteristics_id.ids
|
||||
record.handle_type_id = record.cutting_tool_integral_model_id.handle_type_id.ids
|
||||
record.blade_tip_characteristics_id = record.cutting_tool_integral_model_id.blade_tip_characteristics_id.id
|
||||
record.handle_type_id = record.cutting_tool_integral_model_id.handle_type_id.id
|
||||
record.cutting_direction_ids = record.cutting_tool_integral_model_id.cutting_direction_ids.ids
|
||||
record.suitable_coolant_ids = record.cutting_tool_integral_model_id.suitable_coolant_ids.ids
|
||||
print(record.cutting_tool_integral_model_id.blade_tip_characteristics_id.ids)
|
||||
elif record.cutting_tool_blade_model_id:
|
||||
record.suitable_machining_method_ids = record.cutting_tool_blade_model_id.suitable_machining_method_ids.ids
|
||||
record.blade_tip_characteristics_id = record.cutting_tool_blade_model_id.blade_tip_characteristics_id.ids
|
||||
record.handle_type_id = record.cutting_tool_blade_model_id.handle_type_id.ids
|
||||
record.blade_tip_characteristics_id = record.cutting_tool_blade_model_id.blade_tip_characteristics_id.id
|
||||
record.handle_type_id = record.cutting_tool_blade_model_id.handle_type_id.id
|
||||
record.cutting_direction_ids = record.cutting_tool_blade_model_id.cutting_direction_ids.ids
|
||||
record.suitable_coolant_ids = record.cutting_tool_blade_model_id.suitable_coolant_ids.ids
|
||||
else:
|
||||
record.suitable_machining_method_ids = []
|
||||
record.blade_tip_characteristics_id = []
|
||||
record.handle_type_id = []
|
||||
record.blade_tip_characteristics_id = None
|
||||
record.handle_type_id = None
|
||||
record.cutting_direction_ids = []
|
||||
record.suitable_coolant_ids = []
|
||||
|
||||
@@ -398,11 +401,11 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
"""
|
||||
根据传入的信息新增或者更新功能刀具安全库存的信息
|
||||
"""
|
||||
# 根据功能刀具名称、直径或尖刀R角、粗/中/精查询该功能刀具是否已经存在
|
||||
# 根据功能刀具名称、刀具组、直径或尖刀R角、粗/中/精查询该功能刀具是否已经存在
|
||||
record = self.env['sf.real.time.distribution.of.functional.tools'].search(
|
||||
[('name', '=', vals['name']), ('sf_cutting_tool_type_id', '=', vals['sf_cutting_tool_type_id']),
|
||||
('diameter', '=', vals['diameter']), ('knife_tip_r_angle', '=', vals['knife_tip_r_angle']),
|
||||
('coarse_middle_thin', '=', vals['coarse_middle_thin'])])
|
||||
('coarse_middle_thin', '=', vals['coarse_middle_thin']), ('tool_groups_id', '=', vals['tool_groups_id'])])
|
||||
if len(record) > 0:
|
||||
for obj in record:
|
||||
obj.write({'sf_functional_cutting_tool_entity_ids': [(4, sf_functional_cutting_tool_entity_ids.id)]})
|
||||
@@ -617,7 +620,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False)
|
||||
diameter = fields.Integer(string='刀具直径(mm)', readonly=False)
|
||||
tool_included_angle = fields.Float(string='刀尖R角(mm)', readonly=False)
|
||||
tool_loading_length = fields.Float(strin='总长度(mm)', readonly=False)
|
||||
tool_loading_length = fields.Float(string='总长度(mm)', readonly=False)
|
||||
extension_length = fields.Float(string='伸出长(mm)')
|
||||
effective_length = fields.Float(string='有效长(mm)')
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=False, default='0')
|
||||
|
||||
@@ -121,11 +121,11 @@
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_id" string=""
|
||||
widget="many2one_radio"
|
||||
domain="[('id','in',blade_tip_characteristics_id)]"/>
|
||||
domain="[('id','=',blade_tip_characteristics_id)]"/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_id" string="" widget="many2one_radio"
|
||||
domain="[('id','in',handle_type_id)]"/>
|
||||
domain="[('id','=',handle_type_id)]"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
@@ -351,12 +351,12 @@
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_id" string=""
|
||||
widget="many2one_radio" readonly="1"
|
||||
domain="[('id','in',blade_tip_characteristics_id)]"/>
|
||||
domain="[('id','=',blade_tip_characteristics_id)]"/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_id" string=""
|
||||
widget="many2one_radio" readonly="1"
|
||||
domain="[('id','in',handle_type_id)]"/>
|
||||
domain="[('id','=',handle_type_id)]"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
@@ -37,17 +37,17 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
||||
replacement_tool_name = fields.Char(string='待换功能刀具名称', compute='_compute_name')
|
||||
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换功能刀具类型')
|
||||
replacement_diameter = fields.Integer(string='待换刀具直径(mm)')
|
||||
replacement_knife_tip_r_angle = fields.Float(string='待换刀具刀尖R角(mm)', requride=True)
|
||||
replacement_tool_setting_length = fields.Float(string='待换刀具总长度(mm)', requride=True)
|
||||
replacement_knife_tip_r_angle = fields.Float(string='待换刀具刀尖R角(mm)', required=True)
|
||||
replacement_tool_setting_length = fields.Float(string='待换刀具总长度(mm)', required=True)
|
||||
replacement_extension_length = fields.Float(string='待换刀具伸出长(mm)')
|
||||
replacement_effective_length = fields.Float(string='待换刀具有效长(mm)')
|
||||
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], requride=True,
|
||||
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], requirded=True,
|
||||
string='待换刀具粗/中/精', default='3')
|
||||
|
||||
replacement_max_lifetime_value = fields.Integer(string='待换刀具最大寿命值(min)')
|
||||
replacement_alarm_value = fields.Integer(string='待换刀具报警值(min)')
|
||||
replacement_used_value = fields.Integer(string='待换刀具已使用值(min)')
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', default='0', requride=True)
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', default='0', required=True)
|
||||
replacement_whether_standard_knife = fields.Boolean(string='待换刀具是否标准刀', default=True)
|
||||
used_tool_time = fields.Datetime(string='用刀时间',
|
||||
default=lambda self: fields.Datetime.now() + timedelta(hours=4))
|
||||
@@ -483,6 +483,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
self.env['sf.real.time.distribution.of.functional.tools'].create_or_edit_safety_stock({
|
||||
'name': self.after_assembly_functional_tool_name,
|
||||
'sf_cutting_tool_type_id': self.after_assembly_functional_tool_type_id.id,
|
||||
'tool_groups_id': self.tool_groups_id.id,
|
||||
'diameter': self.after_assembly_functional_tool_diameter,
|
||||
'knife_tip_r_angle': self.after_assembly_knife_tip_r_angle,
|
||||
'coarse_middle_thin': self.after_assembly_coarse_middle_thin,
|
||||
|
||||
Reference in New Issue
Block a user