修复质检接口

This commit is contained in:
jinling.yang
2024-02-28 16:45:50 +08:00
parent a5122e2e18
commit c89f3623f6

View File

@@ -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(