Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
782b3525
提交
782b3525
authored
6月 16, 2025
作者:
贺阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提单下所有小包状态一致才更新提单关务状态
上级
c1ba08b0
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
3 行删除
+15
-3
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+15
-3
没有找到文件。
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
782b3525
...
...
@@ -281,7 +281,7 @@ class CcBl(models.Model):
bl
=
self
.
env
[
'cc.bl'
]
.
sudo
()
.
search
(
[(
'bl_no'
,
'='
,
master_waybill_no
),
(
'create_date'
,
'>='
,
date
)],
limit
=
1
)
if
bl
:
# 根据kws中获取的"img_detail"中的"img_file_code
”
和img_file_type,生成odoo的附件,并关联到cc.bl的bl_attachment_ids字段
# 根据kws中获取的"img_detail"中的"img_file_code
"
和img_file_type,生成odoo的附件,并关联到cc.bl的bl_attachment_ids字段
vals
=
{
'customs_bl_no'
:
kws
.
get
(
'customs_waybill_id'
),
'transport_tool_code'
:
kws
.
get
(
'transport_code'
),
'transport_tool_name'
:
kws
.
get
(
'transport_name'
),
...
...
@@ -368,6 +368,7 @@ class CcBl(models.Model):
"""
根据小包的状态修改提单关务状态以及生成同步日志
:param package_state_obj:小包更新后的状态
:param user_obj:
:return:
"""
# 根据小包的状态找到对应的提单关务状态
...
...
@@ -541,7 +542,12 @@ class CcBl(models.Model):
# 根据小包状态更新提单关务状态
try
:
if
is_ok
and
item
.
ship_package_ids
:
# 检查所有小包状态是否一致
states
=
set
(
item
.
ship_package_ids
.
mapped
(
'state.id'
))
if
len
(
states
)
==
1
:
item
.
change_customs_state_by_ship_package
(
item
.
ship_package_ids
[
0
]
.
state
,
user_obj
=
user_obj
)
else
:
logging
.
info
(
'Not all ship package states are the same, skip updating customs state.'
)
except
Exception
as
e
:
logging
.
info
(
'change_customs_state_by_ship_package error:
%
s'
%
e
)
return
is_ok
...
...
@@ -817,13 +823,18 @@ class CcBl(models.Model):
if
is_ok
:
# 根据小包状态更新提单关务状态
if
self
.
ship_package_ids
:
# 检查所有小包状态是否一致
states
=
set
(
self
.
ship_package_ids
.
mapped
(
'state.id'
))
if
len
(
states
)
==
1
:
self
.
change_customs_state_by_ship_package
(
self
.
ship_package_ids
[
0
]
.
state
,
user_obj
=
user_obj
)
else
:
logging
.
info
(
'Not all ship package states are the same, skip updating customs state.'
)
if
is_ok
:
return
is_ok
logging
.
warning
(
f
"Attempt {i + 1}/{max_retries} failed. Retrying..."
)
return
False
def
mail_auto_push
(
self
,
mail_time
=
False
,
ship_packages
=
[],
action_type
=
'tally'
,
mail_db_user
=
'邮件接收'
,
def
mail_auto_push
(
self
,
mail_time
=
False
,
tally_
ship_packages
=
[],
action_type
=
'tally'
,
mail_db_user
=
'邮件接收'
,
pda_db_user
=
'pda'
):
self
=
self
.
with_context
(
dict
(
self
.
_context
,
is_mail
=
True
))
for
item
in
self
:
...
...
@@ -842,7 +853,8 @@ class CcBl(models.Model):
logging
.
error
(
f
"Failed to push item after {3} attempts."
)
else
:
logging
.
error
(
f
"Failed to start process for item after {3} attempts."
)
elif
ship_packages
:
elif
tally_ship_packages
:
ship_packages
=
[
pkg
for
pkg
in
tally_ship_packages
if
pkg
.
get
(
'bl_id'
)
==
item
.
id
]
user_obj
=
self
.
env
[
'res.users'
]
.
search
([(
'login'
,
'='
,
pda_db_user
)],
limit
=
1
)
ship_package_ids
=
[
ship_package_dict
for
sublist
in
[
d
[
'id'
]
for
d
in
ship_packages
]
for
ship_package_dict
in
sublist
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论