Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 203 additions & 0 deletions auditlog_clickhouse_read/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
===========================================
Read auditlog records stored in clickhouse.
===========================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7ab4f4be05c697769b63a62b6d1c7b080afe57e7a48a9c02ef74ba4683853f50
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/18.0/auditlog_clickhouse_read
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-18-0/server-tools-18-0-auditlog_clickhouse_read
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the audit log integration with ClickHouse to let
Odoo read audit log data through PostgreSQL Foreign Data Wrapper (FDW).

When FDW read mode is enabled, standard Odoo audit log views continue to
work without additional user tools or direct database access, while the
data is read from ClickHouse. Audit log records become read-only in Odoo
while this mode is active.

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

Business need:

In some deployments, audit logs grow quickly and become expensive to
keep and query only in PostgreSQL. At the same time, auditors and
administrators still need to review audit trails from the standard Odoo
interface without learning new tools or getting direct access to
external databases.

This module is useful in environments where audit log storage is moved
to ClickHouse, but end users must continue working with the standard
Odoo Audit Log screens.

Approach:

The module keeps the usual Odoo audit log interface while changing the
read source behind it. Instead of reading audit log data from local
PostgreSQL audit tables, Odoo can read it through PostgreSQL foreign
tables backed by ClickHouse.

This allows administrators to keep the familiar menus, forms, filters,
and grouping options while using ClickHouse as the effective source for
audit log reads.

Useful information:

The module is especially useful in databases with high audit log volumes
or in setups where audit data should be stored outside the main
PostgreSQL audit tables.

When FDW read mode is enabled, audit log records are read-only in Odoo.
If needed, administrators can disable FDW read mode and restore reading
from the local PostgreSQL audit log tables.

Configuration
=============

To configure this module, you need to:

1. Make sure the PostgreSQL extension ``pg_clickhouse`` is installed
and available on the PostgreSQL server used by Odoo.

2. Make sure the ClickHouse database is reachable from the Odoo server.

3. Make sure the audit log tables already exist in ClickHouse.

4. Activate developer mode in Odoo.

5. Go to *Settings > Technical > Auditlog > ClickHouse Configurations*.

6. Open the active ClickHouse configuration used for audit log export.

7. Fill in or verify the connection parameters:

- *Hostname or IP*
- *TCP Port*
- *Database name*
- *User*
- *Password*

8. Use *Test Connection* to verify that Odoo can connect to ClickHouse.

9. Use *Create Auditlog Tables* if the ClickHouse audit log tables have
not yet been created.

10. Click *Enable FDW read* to switch standard Odoo audit log views to
ClickHouse-backed foreign tables.

Important notes:

- Only the active ClickHouse configuration can enable FDW read.
- The PostgreSQL user used by Odoo must have the required privileges to
create and use FDW objects.
- While FDW read is enabled, the active ClickHouse configuration cannot
be deactivated, deleted, or changed for connection-related fields
until FDW read is disabled.

Usage
=====

To use this module, you need to:

1. Go to *Settings > Technical > Auditlog > ClickHouse Configurations*.

2. Open the active ClickHouse configuration.

3. Click *Enable FDW read*.

4. Open the standard audit log menus in Odoo:

- *Settings > Technical > Audit > Logs*

5. Review audit log records as usual from the standard Odoo interface.

6. Use the existing search, filters, and group by options in audit log
views to analyze audit data stored in ClickHouse.

7. Open an audited record and use the standard *View Logs* action when
available. The action continues to open the related audit log entries
through the standard Odoo interface.

Important notes:

- While FDW read mode is enabled, audit log records are read-only in
Odoo.
- To return to local PostgreSQL audit log tables, go back to the active
ClickHouse configuration and click *Disable FDW read*.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20auditlog_clickhouse_read%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Cetmix

Contributors
------------

- `Cetmix <https://cetmix.com/>`__

- Ivan Sokolov
- George Smirnov
- Dmitry Meita

Other credits
-------------

The development of this module has been financially supported by:

- Geschäftsstelle Sozialinfo

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/18.0/auditlog_clickhouse_read>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions auditlog_clickhouse_read/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2026 Cetmix OÜ
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
18 changes: 18 additions & 0 deletions auditlog_clickhouse_read/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2026 Cetmix OÜ
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Read auditlog records stored in clickhouse.",
"version": "18.0.1.0.0",
"summary": "Read auditlog from clickhouse using FDW",
"category": "Tools",
"license": "AGPL-3",
"author": "Odoo Community Association (OCA), Cetmix",
"website": "https://github.com/OCA/server-tools",
"depends": [
"auditlog_clickhouse_write",
],
"data": [
"views/auditlog_clickhouse_config_views.xml",
],
}
Loading
Loading