Compare commits
1 Commits
release/re
...
feature/增加
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6b92ab1da |
@@ -1,5 +1,5 @@
|
||||
import re
|
||||
import json
|
||||
import json, tempfile
|
||||
import logging
|
||||
import base64
|
||||
import urllib.parse
|
||||
@@ -1527,7 +1527,8 @@ class CNCprocessing(models.Model):
|
||||
# 将FTP的多面的程序单文件下载到临时目录
|
||||
def download_file_tmp(self, production_no, processing_panel):
|
||||
remotepath = os.path.join('/home/ftp/ftp_root/NC', production_no, 'return', processing_panel)
|
||||
serverdir = os.path.join('/tmp', production_no, 'return', processing_panel)
|
||||
tmp_path = tempfile.gettempdir()
|
||||
serverdir = os.path.join(tmp_path, production_no, 'return', processing_panel)
|
||||
ftp_resconfig = self.env['res.config.settings'].get_values()
|
||||
ftp = FtpController(str(ftp_resconfig['ftp_host']), int(ftp_resconfig['ftp_port']), ftp_resconfig['ftp_user'],
|
||||
ftp_resconfig['ftp_password'])
|
||||
@@ -1891,7 +1892,7 @@ class WorkPieceDelivery(models.Model):
|
||||
logging.info('delivery_item-name:%s' % delivery_item.name)
|
||||
delivery_item.write({
|
||||
'task_delivery_time': fields.Datetime.now(),
|
||||
'status': '待配送'
|
||||
'status': '已下发'
|
||||
})
|
||||
if delivery_item.type == "上产线":
|
||||
delivery_item.workorder_id.write({'is_delivery': True})
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
import os
|
||||
import tempfile
|
||||
import json
|
||||
import base64
|
||||
from odoo import http
|
||||
@@ -23,6 +24,7 @@ class Sf_Mrs_Connect(http.Controller):
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
ret = json.loads(ret['result'])
|
||||
tmp_path = tempfile.gettempdir()
|
||||
logging.info('下发编程单:%s' % ret)
|
||||
domain = [('programming_no', '=', ret['programming_no'])]
|
||||
if ret['manufacturing_type'] == 'scrap':
|
||||
@@ -32,7 +34,7 @@ class Sf_Mrs_Connect(http.Controller):
|
||||
if productions:
|
||||
# 拉取所有加工面的程序文件
|
||||
for r in ret['processing_panel'].split(','):
|
||||
program_path_tmp_r = os.path.join('/tmp', ret['folder_name'], 'return', r)
|
||||
program_path_tmp_r = os.path.join(tmp_path, ret['folder_name'], 'return', r)
|
||||
if os.path.exists(program_path_tmp_r):
|
||||
files_r = os.listdir(program_path_tmp_r)
|
||||
if files_r:
|
||||
@@ -75,7 +77,7 @@ class Sf_Mrs_Connect(http.Controller):
|
||||
if cnc_workorder:
|
||||
# program_path_tmp_panel = os.path.join('C://Users//43484//Desktop//fsdownload//test',
|
||||
# panel)
|
||||
program_path_tmp_panel = os.path.join('/tmp', ret['folder_name'], 'return', panel)
|
||||
program_path_tmp_panel = os.path.join(tmp_path, ret['folder_name'], 'return', panel)
|
||||
logging.info('program_path_tmp_panel:%s' % program_path_tmp_panel)
|
||||
files_panel = os.listdir(program_path_tmp_panel)
|
||||
if files_panel:
|
||||
|
||||
Reference in New Issue
Block a user