Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
2e92ab17
提交
2e92ab17
authored
12月 16, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
原功能批量获取尾程POD名称改为批量获取货站POD。并将获取的附件的位置由获取到尾程交接POD(待大包数量和箱号)改到货站提货POD上,并同步,其余功能不变。
修改翻译
上级
f20720ee
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
57 行增加
和
35 行删除
+57
-35
zh_CN.po
ccs_base/i18n/zh_CN.po
+0
-0
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+13
-10
order_state_change_rule.py
ccs_base/models/order_state_change_rule.py
+3
-9
cc_bl_view.xml
ccs_base/views/cc_bl_view.xml
+32
-5
batch_get_pod_info_wizard.py
ccs_base/wizard/batch_get_pod_info_wizard.py
+3
-3
batch_get_pod_info_wizard_views.xml
ccs_base/wizard/batch_get_pod_info_wizard_views.xml
+6
-8
没有找到文件。
ccs_base/i18n/zh_CN.po
浏览文件 @
2e92ab17
差异被折叠。
点击展开。
ccs_base/models/cc_bill_loading.py
浏览文件 @
2e92ab17
...
...
@@ -722,7 +722,7 @@ class CcBL(models.Model):
def
cron_get_pod
(
self
):
"""
状态为清关中且附件信息尾程交接POD(待大包数量和箱号),为空的提单,自动获取尾程POD信息
状态为清关中且附件信息尾程交接POD(待大包数量和箱号),为空的提单,自动获取尾程POD信息
暂时不用
"""
fix_name
=
'尾程交接POD(待大包数量和箱号)'
bl_objs
=
self
.
env
[
'cc.bl'
]
.
search
(
...
...
@@ -741,8 +741,7 @@ class CcBL(models.Model):
})
wizard_obj
.
confirm
()
def
_get_pod_files
(
self
):
fix_name
=
'尾程交接POD(待大包数量和箱号)'
def
_get_pod_files
(
self
,
fix_name
):
res
=
[]
for
bl
in
self
:
files
=
self
.
env
[
'cc.clearance.file'
]
.
sudo
()
.
search
(
...
...
@@ -762,8 +761,13 @@ class CcBL(models.Model):
res
.
append
((
name
,
f
.
file
))
return
res
def
action_download_pod
(
self
):
files
=
self
.
_get_pod_files
()
def
action_download_pod
(
self
,
pod_name
):
"""
下载POD
:return:
"""
files
=
self
.
_get_pod_files
(
pod_name
)
if
not
files
:
return
{
'type'
:
'ir.actions.act_window_close'
}
if
len
(
self
)
==
1
and
len
(
files
)
==
1
:
...
...
@@ -1267,20 +1271,19 @@ class CcBL(models.Model):
'target'
:
'new'
}
def
action_batch_download_pod
(
self
):
def
action_batch_download_pod
(
self
,
pod_name
=
''
):
"""
将选中的提单以提单号命名下载尾程交接POD文件,若文件有多个则以提单-1/-2进行命名下载,若选择多个提单,则将所有文件打包成zip,zip命名则以POD进行命名
"""
# 检查是否有选中的提单
if
not
self
:
raise
UserError
(
_
(
'Please select at least one bill of loading.'
))
# 检查是否有尾程交接POD文件
fix_name
=
'尾程交接POD(待大包数量和箱号)'
# 检查是否有尾程交接POD文件或货站提货POD文件
has_files
=
self
.
env
[
'cc.clearance.file'
]
.
search_count
(
[(
'bl_id'
,
'in'
,
self
.
ids
),
(
'file_name'
,
'='
,
fix
_name
),
(
'file'
,
'!='
,
False
)])
[(
'bl_id'
,
'in'
,
self
.
ids
),
(
'file_name'
,
'='
,
pod
_name
),
(
'file'
,
'!='
,
False
)])
if
not
has_files
:
raise
UserError
(
_
(
'Please configure the tail-end handover POD file of the bill of loading first.'
))
return
self
.
action_download_pod
()
return
self
.
action_download_pod
(
pod_name
)
# 增加一个清关进度的业务对象,继承自models.Model, 用于管理业务数据.业务数据包括提单号、清关节点(业务对象)、进度日期、进度描述、更新人
...
...
ccs_base/models/order_state_change_rule.py
浏览文件 @
2e92ab17
...
...
@@ -118,19 +118,17 @@ class OrderStateChangeRule(models.Model):
file_obj
.
is_upload
=
False
file_obj
.
action_sync
()
def
upload_pod_attachment
(
self
,
bl_obj
,
name
,
data
):
"""尾程交接POD(待大包数量和箱号) 文件上传与同步"""
def
upload_pod_attachment
(
self
,
bl_obj
,
name
,
data
,
file_name
=
'货站提货POD'
):
"""尾程交接POD(待大包数量和箱号)
/货站提货POD
文件上传与同步"""
arr
=
[
{
'file_name'
:
'尾程交接POD(待大包数量和箱号)'
,
'file_name'
:
file_name
,
'file'
:
base64
.
encodebytes
(
data
),
'attachment_name'
:
name
,
'is_upload'
:
False
,
'bl_id'
:
bl
.
id
}
for
bl
in
bl_obj
]
# file_objs = self.env['cc.clearance.file'].sudo().search([('file_name', '=', '尾程交接POD(待大包数量和箱号)'),
# ('bl_id', 'in', bl_obj.ids)])
file_objs
=
self
.
env
[
'cc.clearance.file'
]
.
sudo
()
.
create
(
arr
)
# 最大重试次数
max_retries
=
2
...
...
@@ -138,10 +136,6 @@ class OrderStateChangeRule(models.Model):
retries
=
0
while
retries
<=
max_retries
:
try
:
# 设置文件内容
# file_obj.file = base64.encodebytes(data)
# file_obj.attachment_name = name
# file_obj.is_upload = False # 确保文件状态是未上传
# 尝试上传操作
file_obj
.
action_sync
()
# 检查是否上传成功,假设 is_upload 为 False 表示上传失败
...
...
ccs_base/views/cc_bl_view.xml
浏览文件 @
2e92ab17
...
...
@@ -412,9 +412,9 @@
</field>
</record>
<!-- 获取
尾程
POD -->
<!-- 获取
货站提货
POD -->
<record
id=
"bl_get_pod_info_server_action"
model=
"ir.actions.server"
>
<field
name=
"name"
>
Batch Get POD Info
</field>
<field
name=
"name"
>
Batch Get P
ickUp P
OD Info
</field>
<field
name=
"model_id"
ref=
"model_cc_bl"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_bl"
/>
<field
name=
"state"
>
code
</field>
...
...
@@ -426,10 +426,23 @@
</field>
</record>
<!-- 获取尾程快递POD -->
<record
id=
"bl_get_delivery_pod_info_server_action"
model=
"ir.actions.server"
>
<field
name=
"name"
>
Batch Get Delivery POD Info
</field>
<field
name=
"model_id"
ref=
"model_cc_bl"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_bl"
/>
<field
name=
"state"
>
code
</field>
<field
name=
"binding_view_types"
>
list,form
</field>
<field
name=
"groups_id"
eval=
"[(4, ref('ccs_base.group_clearance_of_customs_user'))]"
/>
<field
name=
"code"
>
if records:
action = records.action_batch_get_pod_info()
</field>
</record>
<!--
下载POD
-->
<!--
下载货站提货POD
-->
<record
id=
"bl_download_pod_server_action"
model=
"ir.actions.server"
>
<field
name=
"name"
>
Batch Download POD
</field>
<field
name=
"name"
>
Batch
PickUp
Download POD
</field>
<field
name=
"model_id"
ref=
"model_cc_bl"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_bl"
/>
<field
name=
"state"
>
code
</field>
...
...
@@ -437,8 +450,21 @@
<field
name=
"groups_id"
eval=
"[(4, ref('ccs_base.group_clearance_of_customs_user'))]"
/>
<field
name=
"code"
>
if records:
action = records.action_batch_download_pod()
action = records.action_batch_download_pod(
pod_name='货站提货POD'
)
</field>
</record>
<!-- 下载尾程交接POD -->
<record
id=
"bl_download_delivery_pod_server_action"
model=
"ir.actions.server"
>
<field
name=
"name"
>
Batch Download Delivery POD
</field>
<field
name=
"model_id"
ref=
"model_cc_bl"
/>
<field
name=
"binding_model_id"
ref=
"model_cc_bl"
/>
<field
name=
"state"
>
code
</field>
<field
name=
"binding_view_types"
>
list,form
</field>
<field
name=
"groups_id"
eval=
"[(4, ref('ccs_base.group_clearance_of_customs_user'))]"
/>
<field
name=
"code"
>
if records:
action = records.action_batch_download_pod(pod_name='尾程交接POD(待大包数量和箱号)')
</field>
</record>
</odoo>
\ No newline at end of file
ccs_base/wizard/batch_get_pod_info_wizard.py
浏览文件 @
2e92ab17
...
...
@@ -512,10 +512,11 @@ class BatchGetPodInfoWizard(models.TransientModel):
except
requests
.
exceptions
.
RequestException
as
e
:
raise
ValidationError
(
_
(
'API request failed:
%
s'
)
%
str
(
e
))
def
_write_pdf_file
(
self
,
processed_files
):
def
_write_pdf_file
(
self
,
processed_files
,
fix_name
=
'货站提货POD'
):
"""
Write PDF file to clearance files # 回写PDF文件到清关文件
:param processed_files: 处理后的文件数组
:param fix_name:
"""
for
file_info
in
processed_files
:
if
not
file_info
.
get
(
'bl'
):
...
...
@@ -529,7 +530,6 @@ class BatchGetPodInfoWizard(models.TransientModel):
continue
# 如果有文件为空的就回写,否则就创建新的清关文件记录
fix_name
=
'尾程交接POD(待大包数量和箱号)'
clearance_file
=
self
.
env
[
'cc.clearance.file'
]
.
search
(
[(
'bl_id'
,
'='
,
bl
.
id
),
(
'file_name'
,
'='
,
fix_name
),
(
'file'
,
'='
,
False
)],
limit
=
1
)
if
clearance_file
:
...
...
@@ -542,7 +542,7 @@ class BatchGetPodInfoWizard(models.TransientModel):
# 创建新的清关文件记录
clearance_file
=
self
.
env
[
'cc.clearance.file'
]
.
create
({
'bl_id'
:
bl
.
id
,
'file_name'
:
'尾程交接POD(待大包数量和箱号)'
,
'file_name'
:
fix_name
,
'attachment_name'
:
file_name
,
'file'
:
file_data
})
...
...
ccs_base/wizard/batch_get_pod_info_wizard_views.xml
浏览文件 @
2e92ab17
...
...
@@ -36,10 +36,9 @@
Remove specified text (AGN, UCLINK LOGISITICS LTD) from PDF files
</li>
<!-- 涂抹指定文字:对PDF文件中的指定文字进行涂抹处理 -->
<li
attrs=
"{'invisible': [('sync_successful_processed', '=', False)]}"
>
<strong>
Sync Last Mile POD:
</strong>
Synchronize POD (Proof of Delivery) attachment information with TK system, including
big package quantities and container numbers
</li>
<!-- 同步尾程POD:向TK同步尾程交接POD(待大包数量和箱号)的附件信息 -->
<strong>
Sync Cargo Terminal Pickup POD:
</strong>
Synchronize the attachment information of the POD for picking up goods from TK cargo station
</li>
<!-- 同步货站提货POD:向TK同步货站提货POD的附件信息 -->
<li
attrs=
"{'invisible': [('sync_successful_processed', '=', False)]}"
>
<strong>
Sync Push Match Node:
</strong>
...
...
@@ -106,10 +105,9 @@
<strong>
Description:
</strong>
<!-- 说明: -->
<ul>
<li>
<strong>
Get Last Mile POD:
</strong>
Generate a last mile POD (Proof of Delivery) attachment information, including
big package quantities and container numbers
</li>
<!-- 获取尾程POD:生成一条尾程交接POD(待大包数量和箱号)的附件信息 -->
<strong>
Get Cargo Terminal Pickup POD:
</strong>
Generate a attachment information of the POD for picking up goods cargo station
</li>
<!-- 获取货站提货POD:生成一条货站提货POD的附件信息 -->
<li
attrs=
"{'invisible': [('get_last_mile_pod', '=', False)]}"
>
<strong>
Remove Specified Text:
</strong>
Remove specified text (AGN, UCLINK LOGISITICS LTD) from PDF files
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论