From c89f3623f67bd1119ceefc3f39b8f91b19aa984c Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 28 Feb 2024 16:45:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=A8=E6=A3=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 751a3dd9..abaa5867 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -631,9 +631,9 @@ class ResMrpWorkOrder(models.Model): # 将FTP的检测报告文件下载到临时目录 def download_reportfile_tmp(self, workorder, reportpath): logging.info('reportpath:%s' % reportpath) - production_no = workorder.production_id.name.replace('/', '_') + production_no = reportpath.split('/') # ftp地址 - remotepath = os.path.join('/', production_no, 'detection') + remotepath = os.path.join('/', production_no[1], 'detection') logging.info('ftp地址:%s' % remotepath) if remotepath in reportpath: # 服务器内临时地址 @@ -664,6 +664,7 @@ class CNCprocessing(models.Model): _name = 'sf.cnc.processing' _description = "CNC加工" _rec_name = 'program_name' + _order = 'sequence_number,id' cnc_id = fields.Many2one('ir.attachment') sequence_number = fields.Char('序号') @@ -718,15 +719,11 @@ class CNCprocessing(models.Model): # 根据程序名和加工面匹配到ftp里对应的Nc程序名 def get_cnc_processing_file(self, serverdir, cnc_processing, program_path): - # logging.info('program_path_tmp:%s' % program_path_tmp) - # serverdir = os.path.join('/tmp', folder_name, 'return', processing_panel) logging.info('serverdir:%s' % serverdir) for root, dirs, files in os.walk(serverdir): for f in files: - logging.info('f:%s' % f) if os.path.splitext(f)[1] == ".pdf": full_path = os.path.join(serverdir, root, f) - logging.info('pdf:%s' % full_path) if full_path is not False: if not cnc_processing.workorder_id.cnc_worksheet: cnc_processing.workorder_id.cnc_worksheet = base64.b64encode(