Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
41e1c854
提交
41e1c854
authored
12月 08, 2025
作者:
伍姿英
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release/3.7.1'
上级
132ed07a
78a30a90
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
30 行增加
和
16 行删除
+30
-16
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+5
-1
batch_get_pod_info_wizard.py
ccs_base/wizard/batch_get_pod_info_wizard.py
+25
-15
没有找到文件。
ccs_base/models/cc_bill_loading.py
浏览文件 @
41e1c854
...
...
@@ -782,7 +782,8 @@ class CcBL(models.Model):
if
len
(
self
)
==
1
:
zip_name
=
f
"{self.bl_no or self.id}.zip"
att
=
self
.
env
[
'ir.attachment'
]
.
sudo
()
.
create
(
{
'name'
:
zip_name
,
'datas'
:
datas
,
'res_model'
:
'cc.bl'
,
'res_id'
:
(
self
.
id
if
len
(
self
)
==
1
else
self
[
0
]
.
id
),
{
'name'
:
zip_name
,
'datas'
:
datas
,
'res_model'
:
'cc.bl'
,
'res_id'
:
(
self
.
id
if
len
(
self
)
==
1
else
self
[
0
]
.
id
),
'mimetype'
:
'application/zip'
})
url
=
f
"/web/content/ir.attachment/{att.id}/datas/{att.name}?download=true"
return
{
'type'
:
'ir.actions.act_url'
,
'url'
:
url
,
'target'
:
'self'
}
...
...
@@ -1239,6 +1240,9 @@ class CcBL(models.Model):
def
action_batch_get_pod_info
(
self
):
"""批量获取尾程POD信息"""
is_temp
=
self
.
filtered
(
lambda
x
:
x
.
bl_type
==
'temu'
)
if
is_temp
:
raise
ValidationError
(
_
(
'TEMU提单不支持获取尾程POD信息,请点击批量创建提单!'
))
return
{
'name'
:
_
(
'Batch Get POD Info'
),
'type'
:
'ir.actions.act_window'
,
...
...
ccs_base/wizard/batch_get_pod_info_wizard.py
浏览文件 @
41e1c854
...
...
@@ -126,6 +126,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
预览操作:获取PDF、处理涂抹、合并PDF并显示
"""
action_type
=
self
.
action_type
wizard_name
=
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'Create TEMU Bill of Loading'
)
wizard_form_view
=
[[
self
.
env
.
ref
(
'ccs_base.view_batch_get_pod_info_wizard_form'
)
.
id
,
"form"
]]
if
action_type
==
'获取尾程POD信息'
else
[
[
self
.
env
.
ref
(
'ccs_base.view_batch_create_and_get_pod_info_wizard_form'
)
.
id
,
"form"
]]
self
.
show_error_message
=
False
try
:
bl_objs
=
self
.
get_bl_objs
()
# 获取提单
...
...
@@ -221,26 +226,26 @@ class BatchGetPodInfoWizard(models.TransientModel):
# 返回表单视图
return
{
'type'
:
'ir.actions.act_window'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'Create TEMU Bill of Loading'
),
'name'
:
wizard_name
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'context'
:
{
'active_id'
:
bl_objs
.
ids
if
bl_objs
else
False
}
'context'
:
{
'active_id'
:
bl_objs
.
ids
if
bl_objs
else
False
},
'views'
:
wizard_form_view
,
}
except
Exception
as
e
:
_logger
.
error
(
f
"预览操作失败: {str(e)}"
)
self
.
show_error_message
=
_
(
'预览操作失败:
%
s'
)
%
str
(
e
)
return
{
'type'
:
'ir.actions.act_window'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'Create TEMU Bill of Loading'
),
'name'
:
wizard_name
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'context'
:
{
'active_id'
:
self
.
_context
.
get
(
'active_id'
,
[])}
'context'
:
{
'active_id'
:
self
.
_context
.
get
(
'active_id'
,
[])},
'views'
:
wizard_form_view
}
def
confirm
(
self
):
...
...
@@ -251,6 +256,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
start_time
=
time
.
time
()
self
.
show_error_message
=
False
action_type
=
self
.
action_type
wizard_name
=
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'Create TEMU Bill of Loading'
)
wizard_form_view
=
[[
self
.
env
.
ref
(
'ccs_base.view_batch_get_pod_info_wizard_form'
)
.
id
,
"form"
]]
if
action_type
==
'获取尾程POD信息'
else
[
[
self
.
env
.
ref
(
'ccs_base.view_batch_create_and_get_pod_info_wizard_form'
)
.
id
,
"form"
]]
bl_objs
=
self
.
get_bl_objs
()
if
action_type
==
'获取尾程POD信息'
or
(
action_type
==
'创建temu提单'
and
self
.
get_last_mile_pod
):
# 优先使用已处理的文件数据(预览时已处理)
...
...
@@ -286,12 +296,12 @@ class BatchGetPodInfoWizard(models.TransientModel):
return
{
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'Create TEMU Bill of Loading'
),
'name'
:
wizard_name
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'context'
:
{
'active_id'
:
bl_objs
.
ids
,
}
'context'
:
{
'active_id'
:
bl_objs
.
ids
,
},
'views'
:
wizard_form_view
}
# 检查是否有文字清除失败的错误
...
...
@@ -302,13 +312,13 @@ class BatchGetPodInfoWizard(models.TransientModel):
return
{
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'Create TEMU Bill of Loading'
),
'name'
:
wizard_name
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'context'
:
{
'default_show_error_message'
:
self
.
show_error_message
,
'active_id'
:
bl_objs
.
ids
if
bl_objs
else
False
}
'active_id'
:
bl_objs
.
ids
if
bl_objs
else
False
},
'views'
:
wizard_form_view
}
# 只处理成功涂抹的提单
...
...
@@ -361,13 +371,13 @@ class BatchGetPodInfoWizard(models.TransientModel):
return
{
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'Create TEMU Bill of Loading'
),
'name'
:
wizard_name
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'context'
:
{
'default_show_error_message'
:
self
.
show_error_message
,
'active_id'
:
bl_objs
.
ids
if
bl_objs
else
False
}
'active_id'
:
bl_objs
.
ids
if
bl_objs
else
False
},
'views'
:
wizard_form_view
}
if
action_type
==
'创建temu提单'
:
return
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论