API同步日志框架 / Sync Base API Logger
统一管理外部API调用与回调日志,支持自动重试、Token刷新、日志保留策略
Centralized API sync logging framework with auto-retry, token refresh and log retention policy.
一行代码即可完成外部接口的发送、接收与全链路日志追踪。
功能概述 / Overview
本模块为 Odoo 提供统一的 API 同步日志管理框架。通过服务商→应用→接口类型的三级配置体系, 实现对外部 API 调用的全链路日志记录、自动重试、Token 刷新与过期清理。 业务模块只需一行代码即可集成完整的 HTTP 请求发送与回调接收能力。
This module provides a unified API sync logging framework for Odoo. With a 3-level hierarchy (Provider → App → Log Type), it enables full-chain request logging, auto-retry with token refresh, and configurable log retention. Business modules integrate with just one line of code via send_httprequest() / receive_httprequest().
核心亮点 / Key Highlights
API 日志管理的一站式解决方案
1. 三级配置体系 / 3-Level Hierarchy
Provider → App → Log Type
服务商、应用、接口类型三级管理,URL 正则匹配自动识别接口类型,支持 HTTP 方法、内容格式、重试次数与超时配置。
2. 双向日志记录 / Bidirectional Logging
Outbound & Inbound
完整记录外发请求(方法、URL、请求头、请求体、参数)和响应数据(状态码、响应头、响应体),同时支持入站 Webhook 回调的自动接收与日志记录。
3. 自动重试与Token刷新 / Auto Retry
Token Refresh & Retry Logic
外发请求失败时自动刷新 Token 并按配置次数重试,使用 Savepoint 隔离每条记录处理,防止并发冲突,支持 Token 在 params/headers/URL 中的自动更新。
4. 一行代码集成 / One-line Integration
send_httprequest() / receive_httprequest()
业务模块通过 send_httprequest() 发送请求或 receive_httprequest() 接收回调,自动创建日志记录、执行请求、重试和响应记录,返回标准 Response 对象。
5. 日志保留与自动清理 / Log Retention
Configurable Retention & Auto Cleanup
按接口类型配置日志保留天数,定时任务批量删除过期日志,支持设为 0 表示永久保留,分批删除避免内存溢出。
6. 业务记录关联 / Record Association
res_model / res_id Auto-Link
通过 res_model/res_id 自动关联 API 日志与业务记录,mixin.slog 混入模型让任意业务对象快速集成日志查看按钮。
通用特性 / General Features
多语言与多公司
Multi-Language & Multi-Company
完整的多语言翻译支持,适配全球化企业部署。原生多公司架构,数据严格隔离。
全版本兼容
Full Version Support
支持 Odoo 19,18,17,16,15,14,13,12,EE/CE/.SH,兼容企业版、社区版及在线 SaaS。
代码完全开源
Full Open Source
基于 OPL-1 协议开源,代码透明可审计,支持二次开发与定制。
界面截图 / Screenshots
核心功能界面一览
模块主界面 / Module Overview
使用流程 / How It Works
配置服务商
Setup Providers
定义接口类型
Define Log Types
一行代码调用
One-line API Call
日志监控分析
Monitor & Analyze
支持与依赖模块 / Supported & Dependent Modules
- app_odoo_customize — Odoo 系统定制增强 / Odoo System Customization
odooai.cn
专业Odoo服务伙伴-开发实施咨询培训全套解决方案 / Professional Odoo Solutions
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 12543 |
| Technical Name |
app_sync_base |
| License | OPL-1 |
| Website | https://www.odooai.cn |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module