Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
b4a5dbed
提交
b4a5dbed
authored
12月 08, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
向导返回根据类型指定对应的form视图
上级
85a0d351
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
25 行增加
和
15 行删除
+25
-15
batch_get_pod_info_wizard.py
ccs_base/wizard/batch_get_pod_info_wizard.py
+25
-15
没有找到文件。
ccs_base/wizard/batch_get_pod_info_wizard.py
浏览文件 @
b4a5dbed
...
@@ -126,6 +126,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
...
@@ -126,6 +126,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
预览操作:获取PDF、处理涂抹、合并PDF并显示
预览操作:获取PDF、处理涂抹、合并PDF并显示
"""
"""
action_type
=
self
.
action_type
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
self
.
show_error_message
=
False
try
:
try
:
bl_objs
=
self
.
get_bl_objs
()
# 获取提单
bl_objs
=
self
.
get_bl_objs
()
# 获取提单
...
@@ -221,26 +226,26 @@ class BatchGetPodInfoWizard(models.TransientModel):
...
@@ -221,26 +226,26 @@ class BatchGetPodInfoWizard(models.TransientModel):
# 返回表单视图
# 返回表单视图
return
{
return
{
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'name'
:
wizard_name
,
'Create TEMU Bill of Loading'
),
'res_model'
:
'batch.get.pod.info.wizard'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'view_mode'
:
'form'
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'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
:
except
Exception
as
e
:
_logger
.
error
(
f
"预览操作失败: {str(e)}"
)
_logger
.
error
(
f
"预览操作失败: {str(e)}"
)
self
.
show_error_message
=
_
(
'预览操作失败:
%
s'
)
%
str
(
e
)
self
.
show_error_message
=
_
(
'预览操作失败:
%
s'
)
%
str
(
e
)
return
{
return
{
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'name'
:
wizard_name
,
'Create TEMU Bill of Loading'
),
'res_model'
:
'batch.get.pod.info.wizard'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'view_mode'
:
'form'
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'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
):
def
confirm
(
self
):
...
@@ -251,6 +256,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
...
@@ -251,6 +256,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
start_time
=
time
.
time
()
start_time
=
time
.
time
()
self
.
show_error_message
=
False
self
.
show_error_message
=
False
action_type
=
self
.
action_type
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
()
bl_objs
=
self
.
get_bl_objs
()
if
action_type
==
'获取尾程POD信息'
or
(
action_type
==
'创建temu提单'
and
self
.
get_last_mile_pod
):
if
action_type
==
'获取尾程POD信息'
or
(
action_type
==
'创建temu提单'
and
self
.
get_last_mile_pod
):
# 优先使用已处理的文件数据(预览时已处理)
# 优先使用已处理的文件数据(预览时已处理)
...
@@ -286,12 +296,12 @@ class BatchGetPodInfoWizard(models.TransientModel):
...
@@ -286,12 +296,12 @@ class BatchGetPodInfoWizard(models.TransientModel):
return
{
return
{
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'name'
:
wizard_name
,
'Create TEMU Bill of Loading'
),
'view_mode'
:
'form'
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'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):
...
@@ -302,13 +312,13 @@ class BatchGetPodInfoWizard(models.TransientModel):
return
{
return
{
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'name'
:
wizard_name
,
'Create TEMU Bill of Loading'
),
'view_mode'
:
'form'
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'target'
:
'new'
,
'context'
:
{
'default_show_error_message'
:
self
.
show_error_message
,
'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):
...
@@ -361,13 +371,13 @@ class BatchGetPodInfoWizard(models.TransientModel):
return
{
return
{
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'res_model'
:
'batch.get.pod.info.wizard'
,
'name'
:
_
(
'Batch Get POD Info'
)
if
action_type
==
'获取尾程POD信息'
else
_
(
'name'
:
wizard_name
,
'Create TEMU Bill of Loading'
),
'view_mode'
:
'form'
,
'view_mode'
:
'form'
,
'res_id'
:
self
.
id
,
'res_id'
:
self
.
id
,
'target'
:
'new'
,
'target'
:
'new'
,
'context'
:
{
'default_show_error_message'
:
self
.
show_error_message
,
'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提单'
:
if
action_type
==
'创建temu提单'
:
return
{
return
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论