代码优化

This commit is contained in:
mgw
2024-02-27 17:33:08 +08:00
parent 70038e05c8
commit 586216fa01
2 changed files with 2 additions and 3 deletions

View File

@@ -693,7 +693,7 @@ class CNCprocessing(models.Model):
workorder = self.env['mrp.workorder'].search([('production_id.name', '=', ret['production_order_no']), workorder = self.env['mrp.workorder'].search([('production_id.name', '=', ret['production_order_no']),
('processing_panel', '=', obj['processing_panel']), ('processing_panel', '=', obj['processing_panel']),
('routing_type', '=', 'CNC加工')]) ('routing_type', '=', 'CNC加工')])
logging.info('workorder:%s' % workorder.name) logging.info('workorder:%s' % workorder.id)
logging.info('obj:%s' % obj) logging.info('obj:%s' % obj)
if obj['program_name'] in program_path: if obj['program_name'] in program_path:
logging.info('obj:%s' % obj['program_name']) logging.info('obj:%s' % obj['program_name'])
@@ -711,7 +711,7 @@ class CNCprocessing(models.Model):
'cutting_tool_handle_type': obj['cutting_tool_handle_type'], 'cutting_tool_handle_type': obj['cutting_tool_handle_type'],
'estimated_processing_time': obj['estimated_processing_time'], 'estimated_processing_time': obj['estimated_processing_time'],
'remark': obj['remark'], 'remark': obj['remark'],
'program_path': program_path 'program_path': program_path.replace('/tmp', '')
}) })
cnc_processing.get_cnc_processing_file(program_path_tmp, cnc_processing, program_path) cnc_processing.get_cnc_processing_file(program_path_tmp, cnc_processing, program_path)
# cnc_workorder.state = 'done' # cnc_workorder.state = 'done'

View File

@@ -29,7 +29,6 @@ class FtpController():
logging.info("进入FTP目录 ") logging.info("进入FTP目录 ")
self.ftp.cwd(target_dir) # 切换工作路径 self.ftp.cwd(target_dir) # 切换工作路径
logging.info('FTP目录:%s' % target_dir) logging.info('FTP目录:%s' % target_dir)
self.ftp.mkd('detection')
remotenames = self.ftp.nlst() remotenames = self.ftp.nlst()
logging.info('FTP目录文件:%s' % remotenames) logging.info('FTP目录文件:%s' % remotenames)
for file in remotenames: for file in remotenames: