Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
e7650303
提交
e7650303
authored
5月 07, 2025
作者:
刘擎阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.优化动作跳转
2.日志
上级
b6695019
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
51 行增加
和
3 行删除
+51
-3
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+10
-2
__manifest__.py
ccs_connect_tiktok/__manifest__.py
+1
-0
timer.xml
ccs_connect_tiktok/data/timer.xml
+17
-0
ao_tt_api_log.py
ccs_connect_tiktok/models/ao_tt_api_log.py
+23
-1
没有找到文件。
ccs_base/models/cc_bill_loading.py
浏览文件 @
e7650303
...
@@ -105,7 +105,8 @@ class CcBigPackage(models.Model):
...
@@ -105,7 +105,8 @@ class CcBigPackage(models.Model):
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'cc.package.good'
,
'res_model'
:
'cc.package.good'
,
'view_mode'
:
'tree,form'
,
'view_mode'
:
'tree,form'
,
'domain'
:
[(
'big_package_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
)],
# 'domain': [('big_package_id', '=', self.id), ('is_cancel', '=', False)],
'domain'
:
[(
'bl_line_id'
,
'in'
,
self
.
ship_package_ids
.
ids
),
(
'is_cancel'
,
'='
,
False
)],
}
}
def
action_link_pallet
(
self
):
def
action_link_pallet
(
self
):
...
@@ -865,12 +866,19 @@ class CcBL(models.Model):
...
@@ -865,12 +866,19 @@ class CcBL(models.Model):
# 创建显示商品的action
# 创建显示商品的action
def
action_show_package_good
(
self
):
def
action_show_package_good
(
self
):
# 返回一个action,显示商品
# 返回一个action,显示商品
sql
=
"select id from cc_ship_package where bl_id=
%
s"
%
self
.
id
self
.
_cr
.
execute
(
sql
)
result
=
self
.
_cr
.
fetchall
()
ids
=
[]
if
result
:
ids
=
[
i
[
0
]
for
i
in
result
]
return
{
return
{
'name'
:
_
(
'Goods'
),
'name'
:
_
(
'Goods'
),
'type'
:
'ir.actions.act_window'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'cc.package.good'
,
'res_model'
:
'cc.package.good'
,
'view_mode'
:
'tree,form'
,
'view_mode'
:
'tree,form'
,
'domain'
:
[(
'bl_id'
,
'='
,
self
.
id
),
(
'is_cancel'
,
'='
,
False
)],
# 'domain': [('bl_id', '=', self.id), ('is_cancel', '=', False)],
'domain'
:
[(
'bl_line_id'
,
'in'
,
ids
),
(
'is_cancel'
,
'='
,
False
)],
}
}
# 增加清关截止日期
# 增加清关截止日期
...
...
ccs_connect_tiktok/__manifest__.py
浏览文件 @
e7650303
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
'security/ir.model.access.csv'
,
'security/ir.model.access.csv'
,
# data
# data
'data/data.xml'
,
'data/data.xml'
,
'data/timer.xml'
,
# wizard
# wizard
'wizard/batch_input_ship_package_statu_wizard.xml'
,
'wizard/batch_input_ship_package_statu_wizard.xml'
,
'wizard/update_bl_status_wizard.xml'
,
'wizard/update_bl_status_wizard.xml'
,
...
...
ccs_connect_tiktok/data/timer.xml
0 → 100644
浏览文件 @
e7650303
<odoo>
<data>
<record
id=
"cron_delete_log"
model=
"ir.cron"
>
<field
name=
"name"
>
定时删除历史日志
</field>
<field
name=
"model_id"
ref=
"ccs_connect_tiktok.model_ao_tt_api_log"
/>
<field
name=
"state"
>
code
</field>
<field
name=
"code"
>
model.cron_delete_log()
</field>
<field
name=
'interval_number'
>
2
</field>
<field
name=
'interval_type'
>
hours
</field>
<field
name=
"numbercall"
>
-1
</field>
<field
name=
"active"
eval=
"False"
/>
</record>
</data>
</odoo>
\ No newline at end of file
ccs_connect_tiktok/models/ao_tt_api_log.py
浏览文件 @
e7650303
...
@@ -4,6 +4,7 @@ from datetime import datetime
...
@@ -4,6 +4,7 @@ from datetime import datetime
from
odoo
import
models
,
fields
,
api
,
_
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
ValidationError
,
Warning
from
odoo.exceptions
import
ValidationError
,
Warning
import
logging
import
logging
from
datetime
import
timedelta
_logger
=
logging
.
getLogger
(
__name__
)
_logger
=
logging
.
getLogger
(
__name__
)
...
@@ -14,7 +15,7 @@ class TTErrorLog(models.Model):
...
@@ -14,7 +15,7 @@ class TTErrorLog(models.Model):
_order
=
'id desc'
_order
=
'id desc'
big_bag_no
=
fields
.
Char
(
'业务信息'
,
index
=
True
)
big_bag_no
=
fields
.
Char
(
'业务信息'
,
index
=
True
)
push_time
=
fields
.
Datetime
(
'产生时间'
,
index
=
True
)
push_time
=
fields
.
Datetime
(
'产生时间'
)
error_msg
=
fields
.
Char
(
'失败原因'
)
error_msg
=
fields
.
Char
(
'失败原因'
)
success_bl
=
fields
.
Boolean
(
'是否成功'
,
default
=
False
,
index
=
True
)
success_bl
=
fields
.
Boolean
(
'是否成功'
,
default
=
False
,
index
=
True
)
data_text
=
fields
.
Text
(
'传输数据'
)
data_text
=
fields
.
Text
(
'传输数据'
)
...
@@ -42,3 +43,24 @@ class TTErrorLog(models.Model):
...
@@ -42,3 +43,24 @@ class TTErrorLog(models.Model):
def
deal_tt_error_log
(
self
):
def
deal_tt_error_log
(
self
):
for
item
in
self
:
for
item
in
self
:
item
.
state
=
'已处理'
item
.
state
=
'已处理'
def
cron_delete_log
(
self
):
history_days
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'history_days'
)
or
180
history_limit_log
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'history_limit_log'
)
or
10000
history_limit_log
=
int
(
history_limit_log
)
history_days
=
int
(
history_days
)
current_date
=
datetime
.
utcnow
()
# 计算180天之前的日期
past_date
=
current_date
-
timedelta
(
days
=
history_days
)
sql
=
'select id from ao_tt_api_log where create_date <
%
s order by create_date asc limit
%
s;'
self
.
_cr
.
execute
(
sql
,
(
past_date
,
history_limit_log
))
result
=
self
.
_cr
.
fetchall
()
tk_log_ids
=
[]
if
result
:
tk_log_ids
=
[
i
[
0
]
for
i
in
result
]
if
tk_log_ids
:
log_ids
=
'(
%
s)'
%
str
(
tk_log_ids
)[
1
:
-
1
]
delete_api_log_sql
=
'delete from ao_tt_api_log where id in
%
s'
%
log_ids
self
.
_cr
.
execute
(
delete_api_log_sql
)
self
.
_cr
.
commit
()
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论