屏蔽sf获取编程文件的逻辑

This commit is contained in:
胡尧
2025-03-31 09:06:36 +08:00
parent 1a3590b6b6
commit 21148ae74b
2 changed files with 11 additions and 11 deletions

View File

@@ -1410,10 +1410,10 @@ class MrpProduction(models.Model):
for file_name in files_r:
file_path = os.path.join(program_path_tmp_panel, file_name)
os.remove(file_path)
download_state = self.env['sf.cnc.processing'].download_file_tmp(result['folder_name'],
processing_panel)
if download_state is False:
raise UserError('编程单号为%s的CNC程序文件从FTP拉取失败' % (self.programming_no))
# download_state = self.env['sf.cnc.processing'].download_file_tmp(result['folder_name'],
# processing_panel)
# if download_state is False:
# raise UserError('编程单号为%s的CNC程序文件从FTP拉取失败' % (self.programming_no))
productions = self.env['mrp.production'].search(
[('programming_no', '=', self.programming_no), ('state', 'not in', ('cancel', 'done'))])
if productions:

View File

@@ -49,13 +49,13 @@ class Sf_Mrs_Connect(http.Controller, MultiInheritController):
for file_name in files_r:
file_path = os.path.join(program_path_tmp_r, file_name)
os.remove(file_path)
download_state = request.env['sf.cnc.processing'].with_user(
request.env.ref("base.user_admin")).download_file_tmp(
ret['folder_name'], r)
if download_state is False:
res['status'] = -2
res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no'])
return json.JSONEncoder().encode(res)
# download_state = request.env['sf.cnc.processing'].with_user(
# request.env.ref("base.user_admin")).download_file_tmp(
# ret['folder_name'], r)
# if download_state is False:
# res['status'] = -2
# res['message'] = '编程单号为%s的CNC程序文件从FTP拉取失败' % (ret['programming_no'])
# return json.JSONEncoder().encode(res)
for production in productions:
production.write({'programming_state': '已编程', 'work_state': '已编程', 'is_rework': False})
for panel in ret['processing_panel'].split(','):