Merge remote-tracking branch 'refs/remotes/origin/develop' into feature/tax_sync
This commit is contained in:
@@ -149,7 +149,7 @@ class JdEclp(models.Model):
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
_logger.info('准备调接口1')
|
_logger.info('准备调接口1')
|
||||||
url1 = config['bfm_url'] + '/api/create/jd/order'
|
url1 = config['bfm_url_new'] + '/api/create/jd/order'
|
||||||
requests.post(url1, json=json1, data=None)
|
requests.post(url1, json=json1, data=None)
|
||||||
_logger.info('调用成功1')
|
_logger.info('调用成功1')
|
||||||
_logger.info('准备调接口2')
|
_logger.info('准备调接口2')
|
||||||
@@ -158,7 +158,7 @@ class JdEclp(models.Model):
|
|||||||
'orderNo': self.origin,
|
'orderNo': self.origin,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
url2 = config['bfm_url'] + '/api/get/jd/no'
|
url2 = config['bfm_url_new'] + '/api/get/jd/no'
|
||||||
response = requests.post(url2, json=json2, data=None)
|
response = requests.post(url2, json=json2, data=None)
|
||||||
# _logger.info('调用成功2', response.json()['result']['wbNo'])
|
# _logger.info('调用成功2', response.json()['result']['wbNo'])
|
||||||
tem_ret = response.json().get('result')
|
tem_ret = response.json().get('result')
|
||||||
@@ -196,7 +196,7 @@ class JdEclp(models.Model):
|
|||||||
'no': self.origin,
|
'no': self.origin,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
url1 = config['bfm_url'] + '/api/create/jd/bill'
|
url1 = config['bfm_url_new'] + '/api/create/jd/bill'
|
||||||
response = requests.post(url1, json=json1, data=None)
|
response = requests.post(url1, json=json1, data=None)
|
||||||
# _logger.info('调用成功2', response.json())
|
# _logger.info('调用成功2', response.json())
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class StatusChange(models.Model):
|
|||||||
'process_start_time': process_start_time,
|
'process_start_time': process_start_time,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
url1 = config['bfm_url'] + '/api/get/state/get_order'
|
url1 = config['bfm_url_new'] + '/api/get/state/get_order'
|
||||||
requests.post(url1, json=json1, data=None)
|
requests.post(url1, json=json1, data=None)
|
||||||
logging.info('接口已经执行=============')
|
logging.info('接口已经执行=============')
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ class StatusChange(models.Model):
|
|||||||
'state': '待派单',
|
'state': '待派单',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
url1 = config['bfm_url'] + '/api/get/state/cancel_order'
|
url1 = config['bfm_url_new'] + '/api/get/state/cancel_order'
|
||||||
requests.post(url1, json=json1, data=None)
|
requests.post(url1, json=json1, data=None)
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -8,11 +8,14 @@ _logger = logging.getLogger(__name__)
|
|||||||
class ResBFMConfigSettings(models.TransientModel):
|
class ResBFMConfigSettings(models.TransientModel):
|
||||||
_inherit = 'res.config.settings'
|
_inherit = 'res.config.settings'
|
||||||
|
|
||||||
bfm_url = fields.Selection(
|
# bfm_url = fields.Selection(
|
||||||
[("https://bfm.cs.jikimo.com", "开发环境(https://bfm.cs.jikimo.com)"),
|
# [("https://bfm.cs.jikimo.com", "开发环境(https://bfm.cs.jikimo.com)"),
|
||||||
("https://bfm.t.jikimo.com", "测试环境(https://bfm.t.jikimo.com)"),
|
# ("https://bfm.t.jikimo.com", "测试环境(https://bfm.t.jikimo.com)"),
|
||||||
# ("正式环境", "https://bfm.jikimo.com")], string='bfm环境', store=True)
|
# ("https://bfm.r.jikimo.com", "预发布环境(https://bfm.r.jikimo.com)"),
|
||||||
("https://bfm.jikimo.com", "正式环境(https://bfm.jikimo.com)")], string='bfm环境', store=True)
|
# # ("正式环境", "https://bfm.jikimo.com")], string='bfm环境', store=True)
|
||||||
|
# ("https://bfm.jikimo.com", "正式环境(https://bfm.jikimo.com)")], string='bfm环境', store=True)
|
||||||
|
|
||||||
|
bfm_url_new = fields.Char('业务平台环境路径', placeholder='请输入当前对应的业务平台环境路径')
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def get_values(self):
|
def get_values(self):
|
||||||
@@ -22,14 +25,14 @@ class ResBFMConfigSettings(models.TransientModel):
|
|||||||
"""
|
"""
|
||||||
values = super(ResBFMConfigSettings, self).get_values()
|
values = super(ResBFMConfigSettings, self).get_values()
|
||||||
config = self.env['ir.config_parameter'].sudo()
|
config = self.env['ir.config_parameter'].sudo()
|
||||||
bfm_url = config.get_param('bfm_url', default='')
|
bfm_url_new = config.get_param('bfm_url_new', default='')
|
||||||
|
|
||||||
values.update(
|
values.update(
|
||||||
bfm_url=bfm_url,
|
bfm_url_new=bfm_url_new,
|
||||||
)
|
)
|
||||||
return values
|
return values
|
||||||
|
|
||||||
def set_values(self):
|
def set_values(self):
|
||||||
super(ResBFMConfigSettings, self).set_values()
|
super(ResBFMConfigSettings, self).set_values()
|
||||||
ir_config = self.env['ir.config_parameter'].sudo()
|
ir_config = self.env['ir.config_parameter'].sudo()
|
||||||
ir_config.set_param("bfm_url", self.bfm_url or "")
|
ir_config.set_param("bfm_url_new", self.bfm_url_new or "")
|
||||||
|
|||||||
@@ -14,8 +14,8 @@
|
|||||||
<div class="o_setting_left_pane"/>
|
<div class="o_setting_left_pane"/>
|
||||||
<div class="o_setting_right_pane">
|
<div class="o_setting_right_pane">
|
||||||
<div class="text-muted">
|
<div class="text-muted">
|
||||||
<label for="bfm_url" />
|
<label for="bfm_url_new" />
|
||||||
<field name="bfm_url" string="访问地址"/>
|
<field name="bfm_url_new" string="业务平台访问地址"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
|||||||
@@ -260,40 +260,27 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
request.env['center_control.interface.log'].sudo().create(
|
request.env['center_control.interface.log'].sudo().create(
|
||||||
{'content': ret, 'name': 'AutoDeviceApi/PartQualityInspect'})
|
{'content': ret, 'name': 'AutoDeviceApi/PartQualityInspect'})
|
||||||
production_id = ret['BillId']
|
production_id = ret['BillId']
|
||||||
routing_type = ret['CraftId']
|
# routing_type = ret['CraftId']
|
||||||
workorder = request.env['mrp.workorder'].sudo().search(
|
workorder = request.env['mrp.workorder'].sudo().search(
|
||||||
[('production_id', '=', production_id), ('routing_type', '=', routing_type), ('state', '!=', 'rework')],
|
[('production_id', '=', production_id), ('routing_type', '=', 'CNC加工'),
|
||||||
|
('state', 'not in', ['rework', 'done', 'cancel'])], order='sequence asc',
|
||||||
limit=1)
|
limit=1)
|
||||||
if workorder:
|
if workorder:
|
||||||
# workorder.test_results = ret['Quality']
|
# workorder.test_results = ret['Quality']
|
||||||
logging.info('制造订单:%s' % workorder.production_id.name)
|
logging.info('制造订单:%s' % workorder.production_id.name)
|
||||||
if 'ReportPaht' in ret:
|
if 'ReportPaht' in ret:
|
||||||
download_state = request.env['mrp.workorder'].with_user(
|
if ret['ReportPaht'].find('.pdf') != -1:
|
||||||
request.env.ref("base.user_admin")).download_reportfile_tmp(workorder,
|
download_state = request.env['mrp.workorder'].with_user(
|
||||||
ret['ReportPaht'])
|
request.env.ref("base.user_admin")).download_reportfile_tmp(workorder,
|
||||||
if download_state == 1:
|
ret['ReportPaht'])
|
||||||
detection_ret = request.env['mrp.workorder'].with_user(
|
if download_state is True:
|
||||||
request.env.ref("base.user_admin")).get_detection_file(workorder, ret['ReportPaht'])
|
detection_ret = request.env['mrp.workorder'].with_user(
|
||||||
if detection_ret is True:
|
request.env.ref("base.user_admin")).get_detection_file(workorder, ret['ReportPaht'])
|
||||||
stock_picking_type = request.env['stock.picking.type'].sudo().search(
|
logging.info('detection_ret:%s' % detection_ret)
|
||||||
[('sequence_code', '=', 'SFP')])
|
if detection_ret is False:
|
||||||
if stock_picking_type:
|
res = {'Succeed': False, 'ErrorCode': 205, 'Error': '检测报告文件读取失败'}
|
||||||
stock_picking = request.env['stock.picking'].sudo().search(
|
else:
|
||||||
[('product_id', '=', workorder.product_id.id),
|
res = {'Succeed': False, 'ErrorCode': 204, 'Error': '检测报告文件从FTP拉取失败'}
|
||||||
('origin', '=', workorder.production_id.origin),
|
|
||||||
('picking_type_id', '=', stock_picking_type.id)])
|
|
||||||
if stock_picking:
|
|
||||||
quality_check = request.env['quality.check'].sudo().search(
|
|
||||||
[('product_id', '=', workorder.product_id.id),
|
|
||||||
('picking_id', '=', stock_picking.id)])
|
|
||||||
if quality_check:
|
|
||||||
logging.info('质检单:%s' % quality_check.name)
|
|
||||||
quality_check.write({'report_pdf': workorder.detection_report})
|
|
||||||
elif download_state == 2:
|
|
||||||
res = {'Succeed': False, 'ErrorCode': 205,
|
|
||||||
'Error': 'ReportPaht中的工件号与制造订单%s不匹配,请检查ReportPaht是否正确' % workorder.production_id.name}
|
|
||||||
else:
|
|
||||||
res = {'Succeed': False, 'ErrorCode': 204, 'Error': '检测报告文件从FTP拉取失败'}
|
|
||||||
else:
|
else:
|
||||||
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '未传ReportPaht字段'}
|
res = {'Succeed': False, 'ErrorCode': 203, 'Error': '未传ReportPaht字段'}
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -36,15 +36,13 @@ class MrpProduction(models.Model):
|
|||||||
def _compute_tool_state_remark(self):
|
def _compute_tool_state_remark(self):
|
||||||
for item in self:
|
for item in self:
|
||||||
if item.workorder_ids:
|
if item.workorder_ids:
|
||||||
work_ids = []
|
workorder_ids = item.workorder_ids.filtered(lambda a: a.state not in ['rework', 'done', 'cancel'])
|
||||||
for workorder_id in item.workorder_ids:
|
if workorder_ids.filtered(lambda a: a.tool_state == '1'):
|
||||||
if workorder_id.tool_state == '1':
|
work_ids = workorder_ids.filtered(lambda a: a.tool_state == '1')
|
||||||
work_ids.append(workorder_id)
|
|
||||||
if work_ids:
|
|
||||||
tool_state_remark = ''
|
tool_state_remark = ''
|
||||||
for work_id in work_ids:
|
for work_id in work_ids:
|
||||||
if tool_state_remark == '':
|
if tool_state_remark == '':
|
||||||
tool_state_remark = f"{work_id.tool_state_remark}"
|
tool_state_remark = f'{work_id.tool_state_remark}'
|
||||||
else:
|
else:
|
||||||
tool_state_remark = f"{tool_state_remark}\n{work_id.tool_state_remark}"
|
tool_state_remark = f"{tool_state_remark}\n{work_id.tool_state_remark}"
|
||||||
item.tool_state_remark = tool_state_remark
|
item.tool_state_remark = tool_state_remark
|
||||||
@@ -56,16 +54,10 @@ class MrpProduction(models.Model):
|
|||||||
for item in self:
|
for item in self:
|
||||||
if item.workorder_ids:
|
if item.workorder_ids:
|
||||||
tool_state = item.tool_state
|
tool_state = item.tool_state
|
||||||
work_ids_1 = []
|
workorder_ids = item.workorder_ids.filtered(lambda a: a.state not in ['rework', 'done', 'cancel'])
|
||||||
work_ids_2 = []
|
if workorder_ids.filtered(lambda a: a.tool_state == '2'):
|
||||||
for workorder_id in item.workorder_ids:
|
|
||||||
if workorder_id.tool_state == '2':
|
|
||||||
work_ids_2.append(workorder_id)
|
|
||||||
elif workorder_id.tool_state == '1':
|
|
||||||
work_ids_1.append(workorder_id)
|
|
||||||
if work_ids_2:
|
|
||||||
item.tool_state = '2'
|
item.tool_state = '2'
|
||||||
elif work_ids_1:
|
elif workorder_ids.filtered(lambda a: a.tool_state == '1'):
|
||||||
item.tool_state = '1'
|
item.tool_state = '1'
|
||||||
else:
|
else:
|
||||||
item.tool_state = '0'
|
item.tool_state = '0'
|
||||||
@@ -695,6 +687,9 @@ class MrpProduction(models.Model):
|
|||||||
for work_id in work_ids:
|
for work_id in work_ids:
|
||||||
if panel_sequence_list.get(work_id.name):
|
if panel_sequence_list.get(work_id.name):
|
||||||
work_id.sequence = panel_sequence_list[work_id.name]
|
work_id.sequence = panel_sequence_list[work_id.name]
|
||||||
|
if rec.tool_state in ['1', '2']:
|
||||||
|
rec.workorder_ids.filtered(
|
||||||
|
lambda a: a.routing_type == '装夹预调' and a.state in 'ready').compute_state()
|
||||||
|
|
||||||
# 创建工单并进行排序
|
# 创建工单并进行排序
|
||||||
def _create_workorder(self, item):
|
def _create_workorder(self, item):
|
||||||
|
|||||||
@@ -910,39 +910,49 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# if workorder.state not in ['cancel', 'rework']:
|
# if workorder.state not in ['cancel', 'rework']:
|
||||||
# workorder.state = 'rework'
|
# workorder.state = 'rework'
|
||||||
if workorder.routing_type == '装夹预调' and workorder.state in ['waiting', 'ready', 'pending']:
|
if workorder.routing_type == '装夹预调' and workorder.state in ['waiting', 'ready', 'pending']:
|
||||||
# 当工单对应制造订单的功能刀具状态为 【无效刀】时,先对的第一个装夹预调工单状态设置为 【等待组件】
|
workorder_ids = workorder.production_id.workorder_ids
|
||||||
if workorder.production_id.tool_state in ['1', '2']:
|
work_bo = True
|
||||||
if workorder.state in ['ready']:
|
for wo in workorder_ids.filtered(lambda a: a.routing_type == '装夹预调' and a.state == 'rework'):
|
||||||
workorder.state = 'waiting'
|
if not workorder_ids.filtered(
|
||||||
continue
|
lambda a: (a.routing_type == '装夹预调' and a.state not in ['rework', 'cancel']
|
||||||
elif workorder.state in ['waiting']:
|
and a.processing_panel == wo.processing_panel)):
|
||||||
continue
|
work_bo = False
|
||||||
elif workorder.state == 'pending' and workorder == self.search(
|
break
|
||||||
[('production_id', '=', workorder.production_id.id),
|
if (workorder.production_id.programming_state == '已编程' and work_bo
|
||||||
('routing_type', '=', '装夹预调'),
|
and not workorder_ids.filtered(lambda a: a.sequence == 0)):
|
||||||
('state', 'not in', ['rework', 'done', 'cancel'])],
|
# 当工单对应制造订单的功能刀具状态为 【无效刀】时,先对的第一个装夹预调工单状态设置为 【等待组件】
|
||||||
limit=1,
|
if workorder.production_id.tool_state in ['1', '2']:
|
||||||
order="sequence"):
|
if workorder.state in ['ready']:
|
||||||
workorder.state = 'waiting'
|
workorder.state = 'waiting'
|
||||||
continue
|
continue
|
||||||
elif workorder.production_id.tool_state in ['0']:
|
elif workorder.state in ['waiting']:
|
||||||
if workorder.production_id.workorder_ids.filtered(lambda a: a.state == 'rework'):
|
continue
|
||||||
if not workorder.production_id.workorder_ids.filtered(
|
elif workorder.state == 'pending' and workorder == self.search(
|
||||||
lambda a: (a.routing_type not in ['装夹预调'] and
|
|
||||||
a.state not in ['pending', 'done', 'rework', 'cancel'])):
|
|
||||||
# 查询工序最小的非完工、非返工的装夹预调工单
|
|
||||||
work_id = self.search(
|
|
||||||
[('production_id', '=', workorder.production_id.id),
|
[('production_id', '=', workorder.production_id.id),
|
||||||
('routing_type', '=', '装夹预调'),
|
('routing_type', '=', '装夹预调'),
|
||||||
('state', 'not in', ['rework', 'done', 'cancel'])],
|
('state', 'not in', ['rework', 'done', 'cancel'])],
|
||||||
limit=1,
|
limit=1,
|
||||||
order="sequence")
|
order="sequence"):
|
||||||
if workorder == work_id:
|
workorder.state = 'waiting'
|
||||||
if workorder.production_id.reservation_state == 'assigned':
|
continue
|
||||||
workorder.state = 'ready'
|
elif workorder.production_id.tool_state in ['0']:
|
||||||
elif workorder.production_id.reservation_state != 'assigned':
|
if workorder_ids.filtered(lambda a: a.state == 'rework'):
|
||||||
workorder.state = 'waiting'
|
if not workorder_ids.filtered(
|
||||||
continue
|
lambda a: (a.routing_type not in ['装夹预调'] and
|
||||||
|
a.state not in ['pending', 'done', 'rework', 'cancel'])):
|
||||||
|
# 查询工序最小的非完工、非返工的装夹预调工单
|
||||||
|
work_id = self.search(
|
||||||
|
[('production_id', '=', workorder.production_id.id),
|
||||||
|
('routing_type', '=', '装夹预调'),
|
||||||
|
('state', 'not in', ['rework', 'done', 'cancel'])],
|
||||||
|
limit=1,
|
||||||
|
order="sequence")
|
||||||
|
if workorder == work_id:
|
||||||
|
if workorder.production_id.reservation_state == 'assigned':
|
||||||
|
workorder.state = 'ready'
|
||||||
|
elif workorder.production_id.reservation_state != 'assigned':
|
||||||
|
workorder.state = 'waiting'
|
||||||
|
continue
|
||||||
|
|
||||||
logging.info('工序:%s' % workorder.sequence)
|
logging.info('工序:%s' % workorder.sequence)
|
||||||
logging.info('工单最终状态:%s' % workorder.state)
|
logging.info('工单最终状态:%s' % workorder.state)
|
||||||
@@ -978,6 +988,9 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# elif workorder.production_id.reservation_state != 'assigned' and workorder.state == 'ready':
|
# elif workorder.production_id.reservation_state != 'assigned' and workorder.state == 'ready':
|
||||||
# workorder.state = 'waiting'
|
# workorder.state = 'waiting'
|
||||||
|
|
||||||
|
def compute_state(self):
|
||||||
|
self._compute_state()
|
||||||
|
|
||||||
# 重写工单开始按钮方法
|
# 重写工单开始按钮方法
|
||||||
def button_start(self):
|
def button_start(self):
|
||||||
if self.routing_type == '装夹预调':
|
if self.routing_type == '装夹预调':
|
||||||
@@ -1195,38 +1208,27 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
|
|
||||||
# 将FTP的检测报告文件下载到临时目录
|
# 将FTP的检测报告文件下载到临时目录
|
||||||
def download_reportfile_tmp(self, workorder, reportpath):
|
def download_reportfile_tmp(self, workorder, reportpath):
|
||||||
logging.info('reportpath:%s' % reportpath)
|
logging.info('reportpath/ftp地址:%s' % reportpath)
|
||||||
production_no_ftp = reportpath.split('/')
|
logging.info('processing_panel:%s' % workorder.processing_panel)
|
||||||
production_no = workorder.production_id.name.replace('/', '_')
|
serverdir = os.path.join('/tmp', workorder.production_id.name.replace('/', '_'), 'detection',
|
||||||
# ftp地址
|
workorder.processing_panel)
|
||||||
remotepath = os.path.join('/NC', production_no_ftp[1], 'detection')
|
ftp_resconfig = self.env['res.config.settings'].get_values()
|
||||||
logging.info('ftp地址:%s' % remotepath)
|
ftp = FtpController(str(ftp_resconfig['ftp_host']), int(ftp_resconfig['ftp_port']),
|
||||||
if reportpath.find(production_no) != -1:
|
ftp_resconfig['ftp_user'],
|
||||||
# 服务器内临时地址
|
ftp_resconfig['ftp_password'])
|
||||||
serverdir = os.path.join('/tmp', production_no_ftp[1], 'detection')
|
if not ftp.file_exists_1(reportpath):
|
||||||
ftp_resconfig = self.env['res.config.settings'].get_values()
|
logging.info('文件不存在:%s' % reportpath)
|
||||||
ftp = FtpController(str(ftp_resconfig['ftp_host']), int(ftp_resconfig['ftp_port']),
|
download_state = ftp.download_program_file(reportpath, serverdir)
|
||||||
ftp_resconfig['ftp_user'],
|
logging.info('download_state:%s' % download_state)
|
||||||
ftp_resconfig['ftp_password'])
|
|
||||||
download_state = ftp.download_reportfile_tree(remotepath, serverdir, reportpath)
|
|
||||||
logging.info('download_state:%s' % download_state)
|
|
||||||
else:
|
|
||||||
download_state = 2
|
|
||||||
return download_state
|
return download_state
|
||||||
|
|
||||||
# 根据中控系统提供的检测文件地址去ftp里对应的制造订单里获取
|
# 根据中控系统提供的检测文件地址去ftp里对应的制造订单里获取
|
||||||
def get_detection_file(self, workorder, reportPath):
|
def get_detection_file(self, workorder, reportPath):
|
||||||
# if reportPath.startswith('/'):
|
serverdir = os.path.join('/tmp', workorder.production_id.name.replace('/', '_'), 'detection',
|
||||||
# reportPath = reportPath[4:]
|
workorder.processing_panel)
|
||||||
# serverdir = os.path.join('/tmp', reportPath)
|
|
||||||
serverdir = '/tmp' + reportPath
|
|
||||||
logging.info('get_detection_file-serverdir:%s' % serverdir)
|
logging.info('get_detection_file-serverdir:%s' % serverdir)
|
||||||
serverdir_prefix = os.path.dirname(serverdir)
|
for root, dirs, files in os.walk(serverdir):
|
||||||
logging.info('serverdir_prefix-serverdir:%s' % serverdir_prefix)
|
|
||||||
for root, dirs, files in os.walk(serverdir_prefix):
|
|
||||||
for filename in files:
|
for filename in files:
|
||||||
logging.info('filename:%s' % filename)
|
|
||||||
logging.info('reportPath:%s' % os.path.basename(reportPath))
|
|
||||||
if filename == os.path.basename(reportPath):
|
if filename == os.path.basename(reportPath):
|
||||||
report_file_path = os.path.join(root, filename)
|
report_file_path = os.path.join(root, filename)
|
||||||
logging.info('get_detection_file-report_file_path:%s' % report_file_path)
|
logging.info('get_detection_file-report_file_path:%s' % report_file_path)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ class ReworkWizard(models.TransientModel):
|
|||||||
'sequence_number': cmm_line.sequence_number,
|
'sequence_number': cmm_line.sequence_number,
|
||||||
'program_name': cmm_line.program_name,
|
'program_name': cmm_line.program_name,
|
||||||
'program_path': cmm_line.program_path,
|
'program_path': cmm_line.program_path,
|
||||||
'ftp_path': item_line.program_path,
|
'ftp_path': cmm_line.program_path,
|
||||||
'processing_panel': panel.name,
|
'processing_panel': panel.name,
|
||||||
'program_create_date': datetime.strftime(
|
'program_create_date': datetime.strftime(
|
||||||
cmm_line.program_create_date,
|
cmm_line.program_create_date,
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class FtpController():
|
|||||||
logging.error(f"Error checking file: {e}")
|
logging.error(f"Error checking file: {e}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# 下载目录下的pdf文件(程序单)
|
# 下载目录下的pdf文件(程序单/检测文件)
|
||||||
def download_program_file(self, target_dir, serverdir):
|
def download_program_file(self, target_dir, serverdir):
|
||||||
if not os.path.exists(serverdir):
|
if not os.path.exists(serverdir):
|
||||||
os.makedirs(serverdir)
|
os.makedirs(serverdir)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -158,7 +158,7 @@ class QuickEasyOrder(models.Model):
|
|||||||
payload = {
|
payload = {
|
||||||
'file_path': new_file_path,
|
'file_path': new_file_path,
|
||||||
'dest_path': new_folder_path,
|
'dest_path': new_folder_path,
|
||||||
'back_url': config['bfm_url']
|
'back_url': config['bfm_url_new']
|
||||||
}
|
}
|
||||||
response = requests.post(url, json=payload, headers=headers)
|
response = requests.post(url, json=payload, headers=headers)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from datetime import timedelta, datetime
|
from datetime import timedelta, datetime, date
|
||||||
|
|
||||||
from odoo import fields, models, api
|
from odoo import fields, models, api
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
@@ -603,6 +603,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
功能刀具组装
|
功能刀具组装
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
logging.info('功能刀具开始组装!')
|
||||||
# 获取组装单对象
|
# 获取组装单对象
|
||||||
functional_tool_assembly = self.env['sf.functional.tool.assembly'].search([
|
functional_tool_assembly = self.env['sf.functional.tool.assembly'].search([
|
||||||
('assembly_order_code', '=', self.assembly_order_code),
|
('assembly_order_code', '=', self.assembly_order_code),
|
||||||
@@ -649,6 +650,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
])
|
])
|
||||||
cam_plan.write({'plan_execute_status': '2'})
|
cam_plan.write({'plan_execute_status': '2'})
|
||||||
|
|
||||||
|
logging.info('功能刀具组装完成!')
|
||||||
|
|
||||||
# 关闭弹出窗口
|
# 关闭弹出窗口
|
||||||
return {'type': 'ir.actions.act_window_close'}
|
return {'type': 'ir.actions.act_window_close'}
|
||||||
|
|
||||||
@@ -865,9 +868,10 @@ class StockPicking(models.Model):
|
|||||||
# 设置数量,并验证完成
|
# 设置数量,并验证完成
|
||||||
picking_id.action_set_quantities_to_reservation()
|
picking_id.action_set_quantities_to_reservation()
|
||||||
picking_id.button_validate()
|
picking_id.button_validate()
|
||||||
|
logging.info(f'刀具物料调拨单状态:{picking_id.state}')
|
||||||
|
|
||||||
def _get_name_stock1(self, picking_type_id):
|
def _get_name_stock1(self, picking_type_id):
|
||||||
name = picking_type_id.sequence_id.prefix
|
name = f'{picking_type_id.sequence_id.prefix}DJ/{date.today().strftime("%y")}'
|
||||||
stock_id = self.env['stock.picking'].sudo().search(
|
stock_id = self.env['stock.picking'].sudo().search(
|
||||||
[('name', 'like', name), ('picking_type_id', '=', picking_type_id.id)],
|
[('name', 'like', name), ('picking_type_id', '=', picking_type_id.id)],
|
||||||
limit=1,
|
limit=1,
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
|
<record model="ir.actions.act_window" id="stock.stock_picking_type_action">
|
||||||
|
<field name="context">{'search_default_groupby_code':1}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="view_location_form_sf_inherit" model="ir.ui.view">
|
<record id="view_location_form_sf_inherit" model="ir.ui.view">
|
||||||
<field name="name">stock.location.form.sf.inherit</field>
|
<field name="name">stock.location.form.sf.inherit</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user