forked from OCA/server-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
[18.0][ADD] auditlog_clickhouse_read: add FDW read mode #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tendil
wants to merge
6
commits into
18.0
Choose a base branch
from
18.0-t5248-auditlog_clickhouse_read-add_read_via_pg_clickhouse
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e06fa5b
[ADD] auditlog_clickhouse_read: add FDW read mode
tendil 78974a0
[FIX] auditlog_clickhouse_read: fix tests
tendil 7a1d667
[FIX] auditlog_clickhouse_read: store HTTP audit relations
tendil 5031e5e
[IMP] auditlog_clickhouse_read: resolve ai comments
tendil 0e1ad35
[FIX] auditlog_clickhouse_read: resolve comments
tendil 8b671de
[FIX] auditlog_clickhouse_read: fix test
tendil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| =========================================== | ||
| 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: | ||
|
|
||
| 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. | ||
| - While FDW read is enabled, do not update all Odoo modules and do not | ||
| update the ``auditlog`` module alone. Module updates may recreate or | ||
| alter auditlog PostgreSQL objects and break the FDW-based read setup. | ||
| - Before running any module update that may affect auditlog objects, | ||
| first click *Disable FDW read*. After the update is completed, enable | ||
| FDW read again if needed. | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| To use this module, you need to: | ||
|
|
||
| 1. Click *Enable FDW read*. | ||
|
|
||
| 2. Open the standard audit log menus in Odoo: | ||
|
|
||
| - *Settings > Technical > Audit > Logs* | ||
|
|
||
| 3. Review audit log records as usual from the standard Odoo interface. | ||
|
|
||
| 4. Use the existing search, filters, and group-by options in audit log | ||
| views to analyze audit data stored in ClickHouse. | ||
|
|
||
| 5. 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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", | ||
| ], | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.