胚料bug修复,销售订单明细行路线修复,编程单下发优化

This commit is contained in:
jinling.yang
2022-12-27 17:28:47 +08:00
parent c6b9953e40
commit 5fcb17d048
13 changed files with 158 additions and 112 deletions

View File

@@ -32,20 +32,32 @@ class Sf_Mrs_Connect(http.Controller):
logging.info('model_code:%s' % model_code)
server_dir = cnc.with_user(request.env.ref("base.user_admin")).download_file_tmp(model_code,
processing_panel)
cnc_file_path = os.path.join('/', server_dir, cnc.program_name + '.nc')
logging.info('cnc_file_path:%s' % cnc_file_path)
cnc.with_user(request.env.ref("base.user_admin")).write_file(cnc_file_path, cnc)
logging.info('get_cnc_processing_create:%s' % '111111111111111')
# for root, dirs, files in os.walk(server_dir):
# for f in files:
# if os.path.splitext(f)[1] == ".pdf":
# pdf_path = os.path.splitext(file)[1] + '.PDF'
#
# if pdf_path != False:
# if not cnc.workorder_id.cnc_worksheet:
# cnc.workorder_id.cnc_worksheet = base64.b64encode(open(cnc_pdf_path, 'rb').read())
# else:
# logging.info('break:%s' % 'break')
# break
# cnc_file_path = os.path.join('/', server_dir, cnc.program_name + '.nc')
# logging.info('cnc_file_path:%s' % cnc_file_path)
# cnc.with_user(request.env.ref("base.user_admin")).write_file(cnc_file_path, cnc)
logging.info('server_dir:%s' % server_dir)
for root, dirs, files in os.walk(server_dir):
for f in files:
logging.info('f:%s' % f)
logging.info('f[0]:%s' % f.split('.')[0])
if os.path.splitext(f)[1] == ".pdf":
full_path = os.path.join(server_dir, root, f)
logging.info('pdf:%s' % full_path)
if full_path != False:
if not cnc.workorder_id.cnc_worksheet:
cnc.workorder_id.cnc_worksheet = base64.b64encode(open(full_path, 'rb').read())
else:
logging.info('break:%s' % 'break')
continue
else:
logging.info('cnc.program_name:%s' % cnc.program_name)
if cnc.program_name == f.split('.')[0]:
logging.info('f[0]:%s' % f[0])
cnc_file_path = os.path.join(server_dir, root, f)
logging.info('cnc_file_path:%s' % cnc_file_path)
cnc.with_user(request.env.ref("base.user_admin")).write_file(cnc_file_path, cnc)
else:
continue
except Exception as e:
logging.info('get_cnc_processing_create error:%s' % e)