新增了功能刀具组装界面,新增了功能刀具计划的按键功能,以及按键的显示功能

This commit is contained in:
yuxianghui
2023-06-26 18:10:37 +08:00
parent c37166397e
commit 1348712c83
5 changed files with 219 additions and 46 deletions

View File

@@ -40,12 +40,26 @@ class ToolChangeRequirementInformation(models.TransientModel):
'applicant': self.applicant,
'used_tool_time': self.used_tool_time,
'reason_for_applying': self.reason_for_applying,
'remark': self.new_former
'remark': self.new_former,
'status': '1'
}
# 将数据更新到换刀申请
self.env['sf.machine.table.tool.changing.apply'].amendant_record(desc)
self.env['sf.machine.table.tool.changing.apply'].search(
[('CNC_machine_table', '=', desc.get('CNC_machine_table'))]).write(desc)
# todo 功能刀具组装创建新任务
# 功能刀具组装创建新任务
self.env['sf.machine.table.tool.changing.apply'].new_assembly_task({
'functional_tool_code': self.replacement_tool_code,
'functional_tool_name': self.replacement_tool_name,
'functional_tool_type': self.replacement_tool_type,
'loading_task_source': '1',
'applicant': self.applicant,
'reason_for_applying': self.reason_for_applying,
'use_tool_time': self.used_tool_time,
'machine_tool_name': self.CNC_machine_table,
'machine_tool_code': self.machine_tool_code,
'cutter_spacing_code': self.cutter_spacing_code
})
# 关闭弹出窗口
return {'type': 'ir.actions.act_window_close'}
@@ -81,6 +95,8 @@ class ToolTransferRequestInformation(models.TransientModel):
刀具转移申请信息确定按钮
:return:
"""
self.env['sf.machine.table.tool.changing.apply'].search(
[('CNC_machine_table', '=', self.CNC_machine_table)]).write({'status': '2'})
class ApplyForTooling(models.TransientModel):
@@ -107,11 +123,36 @@ class ApplyForTooling(models.TransientModel):
required_cutting_time = fields.Char(string='需要切割时间', readonly=True)
reason_for_applying = fields.Char(string='申请原因', readonly=True)
applicant = fields.Char(string='申请人', invisible='1')
def apply_for_tooling(self):
"""
申请装刀
:return:
"""
self.env['sf.functional.tool.assembly'].create({
'functional_tool_code': self.functional_tool_code,
'functional_tool_name': self.functional_tool_name,
'functional_tool_type': self.functional_tool_type,
'functional_tool_diameter': self.diameter,
'functional_tool_length': self.tool_loading_length,
'loading_task_source': '0',
'coarse_middle_thin': None,
'tool_loading_length': None,
'applicant': self.applicant,
'reason_for_applying': self.reason_for_applying,
'use_tool_time': self.need_knife_time,
'machine_tool_name': self.machine_table_name,
'machine_tool_code': self.cam_procedure_code,
'cutter_spacing_code': self.cam_cutter_spacing_code
})
# 将计划执行状态改为执行中
self.env['sf.cam.work.order.program.knife.plan'].search(
[('functional_tool_code', '=', self.functional_tool_code)]).write({'plan_execute_status': '1'})
# 关闭弹出窗口
return {'type': 'ir.actions.act_window_close'}