提交 7b89420b authored 作者: 贺阳's avatar 贺阳

优化回写附件文件以及同步

上级 0c22b124
......@@ -484,6 +484,7 @@ class CommonCommon(models.Model):
'file': file_data
})
file_info['clearance_file'] = clearance_file
self.env.cr.commit()
else:
create_vals_list.append({
'bl_id': bl.id,
......@@ -495,9 +496,12 @@ class CommonCommon(models.Model):
if create_vals_list:
new_records = clearance_model.create(create_vals_list)
_logger.info("已创建新清关文件记录: %s", new_records.ids)
self.env.cr.commit()
for clearance_file, file_info in zip(new_records, create_infos):
bl = file_info['bl']
file_info['clearance_file'] = clearance_file
def serialize_pod_processed_files(self, processed_files):
"""
......
......@@ -67,9 +67,10 @@ class Order_dispose(object):
if not non_temu_ids:
return
clearance_ids = clearance_model.search([
('bl_id', 'in', non_temu_ids), ('is_upload', '=', False),
('bl_id', 'in', non_temu_ids),
('file_name', '=', data.get('file_type')),
])
logging.info("已查询到需要同步的清关文件记录: %s", clearance_ids)
if not clearance_ids:
return
clearance_records = clearance_model.browse(clearance_ids)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论