Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
16f58d17
提交
16f58d17
authored
4月 17, 2025
作者:
刘擎阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.增加rpc调用方法
上级
c00efea2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
52 行增加
和
1 行删除
+52
-1
1.txt
ccs_connect_tiktok/controllers/1.txt
+0
-0
cc_bill_loading.py
ccs_connect_tiktok/models/cc_bill_loading.py
+52
-1
没有找到文件。
ccs_connect_tiktok/controllers/1.txt
0 → 100644
浏览文件 @
16f58d17
ccs_connect_tiktok/models/cc_bill_loading.py
浏览文件 @
16f58d17
...
@@ -3,7 +3,7 @@ import asyncio
...
@@ -3,7 +3,7 @@ import asyncio
import
logging
import
logging
import
ssl
import
ssl
from
datetime
import
timedelta
,
datetime
from
datetime
import
timedelta
,
datetime
import
json
import
aiohttp
import
aiohttp
import
certifi
import
certifi
import
pytz
import
pytz
...
@@ -231,6 +231,57 @@ class CcShipPackage(models.Model):
...
@@ -231,6 +231,57 @@ class CcShipPackage(models.Model):
class
CcBl
(
models
.
Model
):
class
CcBl
(
models
.
Model
):
_inherit
=
'cc.bl'
_inherit
=
'cc.bl'
def
custom_mawb_copy_upload
(
self
,
kw
):
# 接收提单的附件信息
res
=
{
"code"
:
0
,
"msg"
:
"success"
,
}
try
:
param_json
=
kw
[
'param_json'
]
if
kw
.
get
(
'param_json'
)
else
{}
if
param_json
:
kws
=
param_json
# 根据kws中获取的master_waybill_no,在系统中查找提单,并将提单的信息更新
master_waybill_no
=
kws
.
get
(
'master_waybill_no'
)
push_interval_15_days
=
self
.
env
[
"ir.config_parameter"
]
.
sudo
()
.
get_param
(
'tk_push_interval_15_days'
)
or
15
# 当前时间-15天
date
=
fields
.
Datetime
.
now
()
-
timedelta
(
days
=
int
(
push_interval_15_days
))
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字段
vals
=
{
'customs_bl_no'
:
kws
.
get
(
'customs_waybill_id'
),
'transport_tool_code'
:
kws
.
get
(
'transport_code'
),
'transport_tool_name'
:
kws
.
get
(
'transport_name'
),
'end_port_code'
:
kws
.
get
(
'arrive_port_code'
)}
img_file_code
=
kws
.
get
(
'img_detail'
)
.
get
(
'img_file_code'
)
img_file_type
=
kws
.
get
(
'img_detail'
)
.
get
(
'img_file_type'
)
file_name
=
'
%
s.
%
s'
%
(
kws
.
get
(
'master_waybill_no'
),
img_file_type
)
img_file_vals
=
dict
(
name
=
file_name
,
res_model
=
'cc.bl'
,
res_id
=
bl
.
id
,
type
=
'binary'
,
datas
=
img_file_code
,
mimetype
=
'image/
%
s'
%
img_file_type
)
img_file
=
self
.
env
[
'ir.attachment'
]
.
sudo
()
.
create
(
img_file_vals
)
if
img_file
:
vals
[
'bl_attachment_ids'
]
=
[(
6
,
0
,
img_file
.
ids
)]
bl
.
write
(
vals
)
else
:
res
[
'code'
]
=
1009
res
[
'msg'
]
=
'master_waybill_no [
%
s] not found.'
%
kws
.
get
(
'master_waybill_no'
)
except
Exception
as
e
:
res
[
'code'
]
=
5000
res
[
'msg'
]
=
'system error:
%
s'
%
str
(
e
)
logging
.
error
(
'mawb_copy_upload error:
%
s'
%
str
(
e
))
self
.
_cr
.
rollback
()
return
res
# 计算未同步小包数量
# 计算未同步小包数量
@api.depends
(
'ship_package_ids'
,
'ship_package_ids.is_sync'
)
@api.depends
(
'ship_package_ids'
,
'ship_package_ids.is_sync'
)
def
_compute_unsync_package_count
(
self
):
def
_compute_unsync_package_count
(
self
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论