修复返工bug

This commit is contained in:
jinling.yang
2024-07-22 10:57:43 +08:00
parent 8a0c968b10
commit 28843b0733
8 changed files with 34 additions and 28 deletions

View File

@@ -95,7 +95,6 @@ class ReworkWizard(models.TransientModel):
if cnc_rework.cnc_ids:
for item_line in cnc_rework.cnc_ids:
vals = {
'processing_panel': item_line.processing_panel,
'sequence_number': item_line.sequence_number,
'program_name': item_line.program_name,
'cutting_tool_name': item_line.cutting_tool_name,
@@ -107,7 +106,9 @@ class ReworkWizard(models.TransientModel):
'cutting_tool_extension_length': item_line.cutting_tool_extension_length,
'estimated_processing_time': item_line.estimated_processing_time,
'cutting_tool_handle_type': item_line.cutting_tool_handle_type,
'ftp_path': item_line.ftp_path,
'program_path': item_line.program_path,
'ftp_path': item_line.program_path,
'processing_panel': panel.name,
'program_create_date': datetime.strftime(item_line.program_create_date,
'%Y-%m-%d %H:%M:%S'),
'remark': item_line.remark
@@ -117,7 +118,9 @@ class ReworkWizard(models.TransientModel):
vals = {
'sequence_number': cmm_line.sequence_number,
'program_name': cmm_line.program_name,
'ftp_path': cmm_line.ftp_path,
'program_path': cmm_line.program_path,
'ftp_path': item_line.program_path,
'processing_panel': panel.name,
'program_create_date': datetime.strftime(cmm_line.program_create_date,
'%Y-%m-%d %H:%M:%S')
}
@@ -137,10 +140,10 @@ class ReworkWizard(models.TransientModel):
if new_pre_workorder:
pre_rework = self.production_id.workorder_ids.filtered(
lambda pr: pr.processing_panel == panel.name and pr.state in (
'rework') and crw.routing_type == '装夹预调')
'rework') and pr.routing_type == '装夹预调')
new_pre_workorder.write(
{'processing_drawing': pre_rework.processing_drawing})
self.production_id.write({'state': 'progress'})
self.production_id.write({'state': 'progress', 'is_rework': False})
if self.is_reprogramming is True:
self.production_id.update_programming_state()
self.production_id.write(