Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hh_ccs
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
贺阳
hh_ccs
Commits
b8fb4866
提交
b8fb4866
authored
4月 01, 2025
作者:
刘擎阳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.优化同步
上级
e45e94d5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
141 行增加
和
5 行删除
+141
-5
__manifest__.py
ccs_base/__manifest__.py
+1
-0
__init__.py
ccs_base/models/__init__.py
+2
-2
cc_bill_loading.py
ccs_base/models/cc_bill_loading.py
+3
-1
history_tt_api_log.py
ccs_base/models/history_tt_api_log.py
+22
-0
ir.model.access.csv
ccs_base/security/ir.model.access.csv
+3
-2
cc_history_ship_package_view.xml
ccs_base/views/cc_history_ship_package_view.xml
+1
-0
history_tt_api_log.xml
ccs_base/views/history_tt_api_log.xml
+104
-0
menu_view.xml
ccs_base/views/menu_view.xml
+3
-0
history_data.py
consumers/history_data.py
+0
-0
requirements.txt
consumers/requirements.txt
+2
-0
没有找到文件。
ccs_base/__manifest__.py
浏览文件 @
b8fb4866
...
...
@@ -41,6 +41,7 @@
'views/cc_history_package_good_view.xml'
,
'views/cc_history_ship_package_view.xml'
,
'views/cc_history_package_sync_log_view.xml'
,
'views/history_tt_api_log.xml'
,
'views/menu_view.xml'
,
# 'views/cc_customers_declaration_order_view.xml',
'templates/login.xml'
,
...
...
ccs_base/models/__init__.py
浏览文件 @
b8fb4866
...
...
@@ -14,4 +14,5 @@ from . import res_config_setting
from
.
import
cc_history_big_package
from
.
import
cc_history_package_good
from
.
import
cc_history_ship_package
from
.
import
cc_history_package_sync_log
\ No newline at end of file
from
.
import
cc_history_package_sync_log
from
.
import
history_tt_api_log
ccs_base/models/cc_bill_loading.py
浏览文件 @
b8fb4866
...
...
@@ -638,11 +638,13 @@ class CcBL(models.Model):
history_days
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'history_days'
)
or
180
history_limit
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'history_limit'
)
or
50
origin_delete
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'origin_delete'
)
or
1
history_limit_log
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'history_limit_log'
)
or
5000
redis_conn
=
self
.
env
[
'common.common'
]
.
sudo
()
.
get_redis
()
vals
=
{
'history_days'
:
history_days
,
'history_limit'
:
history_limit
,
'origin_delete'
:
origin_delete
'origin_delete'
:
origin_delete
,
'history_limit_log'
:
history_limit_log
}
redis_conn
.
lpush
(
'history_data_list'
,
json
.
dumps
(
vals
))
...
...
ccs_base/models/history_tt_api_log.py
0 → 100644
浏览文件 @
b8fb4866
# -*- coding: utf-8 -*-
# Part of SmartGo. See LICENSE file for full copyright and licensing details.
from
datetime
import
datetime
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
ValidationError
,
Warning
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
class
HistoryTTErrorLog
(
models
.
Model
):
_name
=
"history.tt.api.log"
_description
=
"tt推送日志"
_order
=
'id desc'
big_bag_no
=
fields
.
Char
(
'业务信息'
,
index
=
True
)
push_time
=
fields
.
Datetime
(
'产生时间'
,
index
=
True
)
error_msg
=
fields
.
Char
(
'失败原因'
)
success_bl
=
fields
.
Boolean
(
'是否成功'
,
default
=
False
,
index
=
True
)
data_text
=
fields
.
Text
(
'传输数据'
)
request_id
=
fields
.
Char
(
'请求id'
,
index
=
True
)
source
=
fields
.
Selection
([(
'推入'
,
'推入'
),
(
'推出'
,
'推出'
)],
string
=
'类型'
,
default
=
'推入'
)
ccs_base/security/ir.model.access.csv
浏览文件 @
b8fb4866
...
...
@@ -73,4 +73,5 @@ order_state_change_rule_group_user,order_state_change_rule_group_user,ccs_base.m
access_cc_history_big_package_base.group_user,cc_history_big_package base.group_user,ccs_base.model_cc_history_big_package,base.group_user,1,1,1,1
access_cc_history_package_good_base.group_user,cc_history_package_good base.group_user,ccs_base.model_cc_history_package_good,base.group_user,1,1,1,1
access_cc_history_ship_package_base.group_user,cc_history_ship_package base.group_user,ccs_base.model_cc_history_ship_package,base.group_user,1,1,1,1
access_cc_history_package_sync_log_base.group_user,cc_history_package_sync_log base.group_user,ccs_base.model_cc_history_package_sync_log,base.group_user,1,1,1,1
\ No newline at end of file
access_cc_history_package_sync_log_base.group_user,cc_history_package_sync_log base.group_user,ccs_base.model_cc_history_package_sync_log,base.group_user,1,1,1,1
access_history_tt_api_log_base.group_user,history_tt_api_log base.group_user,ccs_base.model_history_tt_api_log,base.group_user,1,1,1,1
\ No newline at end of file
ccs_base/views/cc_history_ship_package_view.xml
浏览文件 @
b8fb4866
...
...
@@ -7,6 +7,7 @@
<field
name=
"arch"
type=
"xml"
>
<tree
string=
"Ship Package"
decoration-warning=
"is_cancel==True"
>
<field
optional=
"show"
name=
"state"
string=
"Progress"
widget=
"badge"
decoration-info=
"1 == 1"
/>
<field
name=
"is_sync"
string=
"是否同步"
/>
<field
optional=
"show"
name=
"process_time"
/>
<field
optional=
"show"
name=
"tracking_no"
string=
"Tracking No."
/>
<field
optional=
"show"
name=
"trade_no"
/>
...
...
ccs_base/views/history_tt_api_log.xml
0 → 100644
浏览文件 @
b8fb4866
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
# ---------- TIKTOK推送日志 ------------
<record
model=
"ir.ui.view"
id=
"tree_history_tt_api_log_view"
>
<field
name=
"name"
>
tree.history.tt.api.log
</field>
<field
name=
"model"
>
history.tt.api.log
</field>
<field
name=
"arch"
type=
"xml"
>
<tree
string=
"TIKTOK推送日志"
>
<field
name=
"source"
/>
<field
name=
"big_bag_no"
/>
<field
name=
"push_time"
/>
<field
name=
"error_msg"
/>
<field
name=
"success_bl"
/>
<field
name=
"request_id"
/>
<field
name=
"create_date"
optional=
"hide"
/>
</tree>
</field>
</record>
<record
model=
"ir.ui.view"
id=
"form_history_tt_api_log_view"
>
<field
name=
"name"
>
form.history.tt.api.log
</field>
<field
name=
"model"
>
history.tt.api.log
</field>
<field
name=
"arch"
type=
"xml"
>
<form
string=
"TIKTOK推送日志"
>
<sheet>
<group>
<field
name=
"source"
/>
<field
name=
"big_bag_no"
/>
<field
name=
"push_time"
/>
<field
name=
"error_msg"
/>
<field
name=
"success_bl"
/>
<field
name=
"request_id"
/>
<field
name=
"data_text"
/>
</group>
</sheet>
</form>
</field>
</record>
<record
model=
"ir.ui.view"
id=
"search_history_tt_api_log_view"
>
<field
name=
"name"
>
search.history.tt.api.log
</field>
<field
name=
"model"
>
history.tt.api.log
</field>
<field
name=
"arch"
type=
"xml"
>
<search
string=
"TIKTOK推送日志"
>
<filter
string=
"今日日志"
domain=
"[('create_date', '>=', (datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S')), ('create_date', '<', (datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)).to_utc() + datetime.timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S'))]"
name=
"create_date"
/>
<filter
string=
"昨日日志"
domain=
"[('create_date', '>=', (datetime.datetime.combine(context_today() - datetime.timedelta(days=1), datetime.time(0, 0, 0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S')), ('create_date', '<', (datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S'))]"
name=
"last_24h"
/>
<filter
string=
"近7日日志"
domain=
"[('create_date', '>=', (datetime.datetime.combine(context_today() - datetime.timedelta(days=7), datetime.time(0, 0, 0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S')),('create_date', '<', (datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)).to_utc() + datetime.timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S'))]"
name=
"last_7d"
/>
<filter
string=
"本周日志"
name=
"this_week_log"
domain=
"[('create_date', '>=', (datetime.datetime.combine(context_today() + relativedelta(weeks=-1,days=1,weekday=0), datetime.time(0,0,0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S')),
('create_date', '<', (datetime.datetime.combine(context_today() + relativedelta(days=1,weekday=0), datetime.time(0,0,0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S'))]"
/>
<filter
string=
"上周日志"
name=
"last_week_log"
domain=
"[('create_date', '>=', (datetime.datetime.combine(context_today() + relativedelta(weeks=-2,days=1,weekday=0), datetime.time(0,0,0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S')),
('create_date', '<', (datetime.datetime.combine(context_today() + relativedelta(weeks=-1,days=1,weekday=0), datetime.time(0,0,0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S'))]"
/>
<!-- <filter string="本月日志" name="this_month_log"-->
<!-- domain="[('create_date','>=', time.strftime('%Y-%m-1 00:00:00')),('create_date','<',(context_today() + relativedelta(months=1)).strftime('%Y-%m-1 00:00:00'))]"/>-->
<!-- <filter string="上月日志" name="last_month_log"-->
<!-- domain="[('create_date','<', time.strftime('%Y-%m-1 00:00:00')),('create_date','>=',(context_today() - relativedelta(months=1)).strftime('%Y-%m-1 00:00:00'))]"/>-->
<filter
string=
"近30日日志"
name=
"last_30d"
domain=
"[('create_date', '>=', (datetime.datetime.combine(context_today() - datetime.timedelta(days=30), datetime.time(0, 0, 0)).to_utc()).strftime('%Y-%m-%d %H:%M:%S')), ('create_date', '<', (datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)).to_utc() + datetime.timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S'))]"
/>
<separator/>
<field
name=
"big_bag_no"
/>
<field
name=
"data_text"
/>
<separator/>
<filter
name=
"filter_success_bl"
string=
"成功"
domain=
"[('success_bl','=',True)]"
/>
<filter
name=
"filter_not_success_bl"
string=
"失败"
domain=
"[('success_bl','=',False)]"
/>
<separator/>
<group
expand=
"0"
string=
"分组"
>
<filter
domain=
"[]"
name=
"groupby_success_bl"
string=
"是否成功"
context=
"{'group_by': 'success_bl'}"
/>
<filter
domain=
"[]"
name=
"groupby_big_bag_no"
string=
"业务信息"
context=
"{'group_by': 'big_bag_no'}"
/>
<filter
domain=
"[]"
name=
"groupby_source"
string=
"类型"
context=
"{'group_by': 'source'}"
/>
</group>
<searchpanel>
<field
icon=
"fa-users"
select=
"multi"
name=
"source"
/>
</searchpanel>
</search>
</field>
</record>
<record
model=
"ir.actions.act_window"
id=
"action_history_tt_api_log"
>
<field
name=
"name"
>
TIKTOK推送日志
</field>
<field
name=
"res_model"
>
history.tt.api.log
</field>
<field
name=
"view_mode"
>
tree,form,search
</field>
<field
name=
"domain"
>
[]
</field>
<field
name=
"context"
>
{'search_default_last_30d':1}
</field>
</record>
</data>
</odoo>
\ No newline at end of file
ccs_base/views/menu_view.xml
浏览文件 @
b8fb4866
...
...
@@ -61,5 +61,7 @@
<menuitem
parent=
"menu_cc_history_data"
sequence=
"3"
name=
"History Ship Package"
id=
"menu_cc_history_ship_package"
action=
"action_cc_history_ship_package"
/>
<menuitem
parent=
"menu_cc_history_data"
id=
"menu_history_flight_tt_api_log"
name=
"TIKTOK推送日志"
sequence=
"7"
action=
"action_history_tt_api_log"
/>
</data>
</odoo>
\ No newline at end of file
consumers/history_data.py
浏览文件 @
b8fb4866
差异被折叠。
点击展开。
consumers/requirements.txt
0 → 100644
浏览文件 @
b8fb4866
sqlalchemy
pandas
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论