优化刀具管理form视图表名显示问题
This commit is contained in:
@@ -110,7 +110,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
# string='换刀需求信息',
|
||||
# attrs="{'invisible': 1}")
|
||||
|
||||
CNC_machine_table = fields.Char(string='CNC机床')
|
||||
name = fields.Char(string='CNC机床')
|
||||
# todo 机床类型和刀位号 为 Many2one
|
||||
machine_table_type = fields.Char(string='机床类型')
|
||||
machine_tool_code = fields.Char(string='机台号', attrs="{'invisible': 1}")
|
||||
@@ -151,7 +151,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
# todo 自动换刀申请条件需补充完善
|
||||
if(self.functional_tool_status == '异常'):
|
||||
self.env['sf.machine.table.tool.changing.apply'].search([
|
||||
('CNC_machine_table', '=', self.CNC_machine_table)]).write({
|
||||
('name', '=', self.name)]).write({
|
||||
'replacement_tool_code': self.functional_tool_code,
|
||||
'replacement_tool_name': self.functional_tool_name,
|
||||
'replacement_tool_type': self.functional_tool_type,
|
||||
@@ -167,7 +167,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
# 新建组装任务
|
||||
self.env['sf.functional.tool.assembly'].create({
|
||||
'functional_tool_code': self.functional_tool_code,
|
||||
'functional_tool_name': self.functional_tool_name,
|
||||
'name': self.functional_tool_name,
|
||||
'functional_tool_type': self.functional_tool_type,
|
||||
'functional_tool_diameter': self.diameter,
|
||||
'loading_task_source': '1',
|
||||
@@ -189,7 +189,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
"""
|
||||
# 增加设置直径的值
|
||||
tool_changing_apply = self.env['sf.machine.table.tool.changing.apply'].search(
|
||||
[('CNC_machine_table', '=', vals['machine_tool_name'])])
|
||||
[('name', '=', vals['name'])])
|
||||
vals['functional_tool_diameter'] = tool_changing_apply.diameter
|
||||
|
||||
self.env['sf.functional.tool.assembly'].create(vals)
|
||||
@@ -201,7 +201,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
:return:
|
||||
"""
|
||||
# 撤回数据更新
|
||||
self.env['sf.machine.table.tool.changing.apply'].search([('CNC_machine_table', '=', self.CNC_machine_table)]).write({
|
||||
self.env['sf.machine.table.tool.changing.apply'].search([('name', '=', self.name)]).write({
|
||||
'replacement_tool_code': None,
|
||||
'replacement_tool_name': None,
|
||||
'replacement_tool_type': None,
|
||||
@@ -225,7 +225,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
:return:
|
||||
"""
|
||||
self.env['sf.machine.table.tool.changing.apply'].search(
|
||||
[('CNC_machine_table', '=', self.CNC_machine_table)]).write({
|
||||
[('name', '=', self.name)]).write({
|
||||
'status': '0'
|
||||
})
|
||||
|
||||
@@ -234,7 +234,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
_name = 'sf.cam.work.order.program.knife.plan'
|
||||
_description = 'CAM工单程序用刀计划'
|
||||
|
||||
ticket_task_code = fields.Char(string='工单任务编号')
|
||||
name = fields.Char(string='工单任务编号')
|
||||
cam_procedure_code = fields.Char(string='CAM程序编号')
|
||||
cam_cutter_spacing_code = fields.Char(string='CAM刀位号')
|
||||
functional_tool_code = fields.Char(string='功能刀具编码')
|
||||
@@ -263,7 +263,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
"""
|
||||
self.env['sf.functional.tool.assembly'].create({
|
||||
'functional_tool_code': self.functional_tool_code,
|
||||
'functional_tool_name': self.functional_tool_name,
|
||||
'name': self.functional_tool_name,
|
||||
'functional_tool_type': self.functional_tool_type,
|
||||
'functional_tool_diameter': self.diameter,
|
||||
'functional_tool_length': self.tool_loading_length,
|
||||
@@ -304,7 +304,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
_order = 'use_tool_time asc'
|
||||
|
||||
functional_tool_code = fields.Char(string='功能刀具编码')
|
||||
functional_tool_name = fields.Char(string='功能刀具名称')
|
||||
name = fields.Char(string='功能刀具名称')
|
||||
functional_tool_type = fields.Char(string='功能刀具类型')
|
||||
functional_tool_diameter = fields.Char(string='功能刀具直径')
|
||||
functional_tool_length = fields.Char(string='功能刀具伸出长')
|
||||
@@ -389,7 +389,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
for val in vals:
|
||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
||||
'functional_tool_code': val.functional_tool_code,
|
||||
'functional_tool_name': val.functional_tool_name,
|
||||
'name': val.name,
|
||||
'functional_tool_type': val.functional_tool_type,
|
||||
'production_line_name': val.production_line_name,
|
||||
'machine_tool_code': val.machine_tool_code,
|
||||
@@ -399,7 +399,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
else:
|
||||
self.env['sf.delivery.of.cargo.from.storage'].create({
|
||||
'functional_tool_code': self.functional_tool_code,
|
||||
'functional_tool_name': self.functional_tool_name,
|
||||
'name': self.name,
|
||||
'functional_tool_type': self.functional_tool_type,
|
||||
'production_line_name': self.production_line_name,
|
||||
'machine_tool_code': self.machine_tool_code,
|
||||
|
||||
Reference in New Issue
Block a user