From 9e8d83cbb8574ce4d0382fc991110dc381ea3a3b Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Tue, 24 Nov 2026 22:40:16 +0800 Subject: [PATCH 1/6] fix(spp_audit): mark server-internal audit methods as private The audit backend methods and the rule's logging entry points are called only from server-side code. Mark them @api.private and cover it with tests. Server-side callers are unaffected. --- spp_audit/__manifest__.py | 2 +- spp_audit/models/spp_audit_backend.py | 13 ++ spp_audit/models/spp_audit_rule.py | 9 ++ spp_audit/readme/HISTORY.md | 4 + spp_audit/tests/__init__.py | 1 + spp_audit/tests/test_rpc_exposure.py | 175 ++++++++++++++++++++++++++ 6 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 spp_audit/tests/test_rpc_exposure.py diff --git a/spp_audit/__manifest__.py b/spp_audit/__manifest__.py index 5fd431915..ff882d7bc 100644 --- a/spp_audit/__manifest__.py +++ b/spp_audit/__manifest__.py @@ -3,7 +3,7 @@ "name": "OpenSPP Audit", "summary": "Comprehensively tracks all data modifications and user actions across the OpenSPP platform, recording old and new values for configured data. It enhances accountability and data integrity by maintaining an immutable history of changes, crucial for internal audits, compliance, and detecting unauthorized alterations. Supports multiple backends (database, file, syslog, HTTP) with tamper-resistant configuration.", "category": "OpenSPP/Monitoring", - "version": "19.0.2.0.2", + "version": "19.0.2.0.3", "sequence": 1, "author": "OpenSPP.org", "website": "https://github.com/OpenSPP/OpenSPP2", diff --git a/spp_audit/models/spp_audit_backend.py b/spp_audit/models/spp_audit_backend.py index 5ba83481b..46100fa50 100644 --- a/spp_audit/models/spp_audit_backend.py +++ b/spp_audit/models/spp_audit_backend.py @@ -118,12 +118,16 @@ class SppAuditBackend(models.AbstractModel): Subclasses must implement _write_entry() to handle the actual storage of audit entries. + + Backend methods are private: they are for trusted server code only and + are not RPC-dispatchable. """ _name = "spp.audit.backend" _description = "Abstract Audit Backend" @api.model + @api.private def write_entry(self, entry, env=None): """Write an audit entry to this backend. @@ -144,6 +148,7 @@ def write_entry(self, entry, env=None): raise NotImplementedError("Subclasses must implement write_entry()") @api.model + @api.private def is_enabled(self, env=None): """Check if this backend is enabled.""" raise NotImplementedError("Subclasses must implement is_enabled()") @@ -157,10 +162,12 @@ class SppAuditBackendDb(models.AbstractModel): _description = "Database Audit Backend" @api.model + @api.private def is_enabled(self, env=None): return AuditConfig.get_bool("backend_db", env=env) @api.model + @api.private def write_entry(self, entry, env=None): """Write audit entry to database. @@ -188,6 +195,7 @@ class SppAuditBackendFile(models.AbstractModel): _current_date = None @api.model + @api.private def is_enabled(self, env=None): return AuditConfig.get_bool("backend_file", env=env) @@ -237,6 +245,7 @@ def _get_file_handle(cls, env=None): return cls._file_handle @api.model + @api.private def write_entry(self, entry, env=None): """Write audit entry to JSONL file.""" try: @@ -265,6 +274,7 @@ class SppAuditBackendSyslog(models.AbstractModel): _syslog_initialized = False @api.model + @api.private def is_enabled(self, env=None): return AuditConfig.get_bool("backend_syslog", env=env) @@ -293,6 +303,7 @@ def _init_syslog(cls, env=None): cls._syslog_initialized = True @api.model + @api.private def write_entry(self, entry, env=None): """Write audit entry to syslog.""" try: @@ -317,6 +328,7 @@ class SppAuditBackendHttp(models.AbstractModel): _description = "HTTP Webhook Audit Backend" @api.model + @api.private def is_enabled(self, env=None): if not AuditConfig.get_bool("backend_http", env=env): return False @@ -325,6 +337,7 @@ def is_enabled(self, env=None): return bool(endpoint) @api.model + @api.private def write_entry(self, entry, env=None): """Write audit entry to HTTP endpoint.""" endpoint = AuditConfig.get("http_endpoint", env=env) diff --git a/spp_audit/models/spp_audit_rule.py b/spp_audit/models/spp_audit_rule.py index 159321f63..0555a4949 100644 --- a/spp_audit/models/spp_audit_rule.py +++ b/spp_audit/models/spp_audit_rule.py @@ -225,10 +225,13 @@ def _process_action_id(self): return @api.model + @api.private def get_audit_rules(self, method): """ The function returns audit rules based on the specified method. + Private: not RPC-dispatchable, on this model or on the audited models it is attached to. + :param method: The "method" parameter is a string that specifies the type of operation being performed. It can have one of the following values: "create", "write", or "unlink" :return: The method is returning a search result of "spp.audit.rule" records based on the @@ -526,10 +529,13 @@ def get_audit_log_vals(self, res_id, method, data): "parent_res_ids_str": ",".join(parent_res_ids), } + @api.private def log(self, method, old_values=None, new_values=None): """ Log changes made to a model's records by dispatching to all enabled backends. + Private: for server-side callers only, not RPC-dispatchable. + :param method: The operation type: "create", "write", "unlink", or lifecycle action :param old_values: Dict of previous field values :param new_values: Dict of updated field values @@ -572,12 +578,15 @@ def log(self, method, old_values=None, new_values=None): ) @api.model + @api.private def log_lifecycle_action(self, model_name, record_id, action, old_values=None, new_values=None): """Log a lifecycle action for a record. This is called explicitly from models (not via decorator). Used for activate/deactivate/approve/reject/set_draft/download/preview/export actions. + Private: for server-side callers only, not RPC-dispatchable. + :param model_name: Technical model name (e.g., 'spp.studio.field') :param record_id: ID of the record being logged :param action: Action type - 'activate', 'deactivate', 'set_draft', 'approve', 'reject', diff --git a/spp_audit/readme/HISTORY.md b/spp_audit/readme/HISTORY.md index 2d8ce06c2..d200195cc 100644 --- a/spp_audit/readme/HISTORY.md +++ b/spp_audit/readme/HISTORY.md @@ -1,3 +1,7 @@ +### 19.0.2.0.3 + +- fix: mark the server-internal audit methods `@api.private` — backend `write_entry` / `is_enabled` and the rule's `log`, `log_lifecycle_action`, `get_audit_rules`; server-side callers are unaffected + ### 19.0.2.0.2 - feat: `audit_disable` context key lets trusted machine flows (e.g. cross-instance replication of records already audited at their source) bypass audit logging and its full-record snapshot reads in create/write/unlink diff --git a/spp_audit/tests/__init__.py b/spp_audit/tests/__init__.py index a34105c34..bbd45ecb8 100644 --- a/spp_audit/tests/__init__.py +++ b/spp_audit/tests/__init__.py @@ -1,4 +1,5 @@ from . import test_audit_backend from . import test_audit_disable from . import test_html_escaping +from . import test_rpc_exposure from . import test_spp_audit_rule diff --git a/spp_audit/tests/test_rpc_exposure.py b/spp_audit/tests/test_rpc_exposure.py new file mode 100644 index 000000000..0fa4861dc --- /dev/null +++ b/spp_audit/tests/test_rpc_exposure.py @@ -0,0 +1,175 @@ +"""Audit internals are server-side only and not RPC-dispatchable. + +The audit backends and the rule's logging entry points write to the audit +trail on behalf of the server. +""" + +import json +import os +import shutil +import tempfile +from unittest.mock import patch + +from odoo import Command +from odoo.exceptions import AccessError +from odoo.service.model import call_kw +from odoo.tests.common import TransactionCase, new_test_user + +BACKEND_MODELS = [ + "spp.audit.backend", + "spp.audit.backend.db", + "spp.audit.backend.file", + "spp.audit.backend.syslog", + "spp.audit.backend.http", +] + +SAMPLE_ENTRY = { + "seq": 1, + "ts": "2000-01-01T00:00:00+00:00", + "node": "test-node", + "rule_name": "Sample", + "model": "res.partner", + "res_id": 1, + "method": "write", + "user_id": 1, + "user_login": "sample.user", + "data": {"old": {"name": "Old"}, "new": {"name": "New"}}, +} + +PRIVATE_ERROR = "cannot be called remotely" + + +class RpcExposureCommon(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.internal_user = new_test_user(cls.env, login="audit_rpc_internal", groups="base.group_user") + cls.portal_user = new_test_user(cls.env, login="audit_rpc_portal", groups="base.group_portal") + cls.audit_manager = new_test_user( + cls.env, + login="audit_rpc_manager", + groups="base.group_user,spp_audit.group_audit_manager", + ) + partner_model = cls.env["ir.model"].search([("model", "=", "res.partner")], limit=1) + cls.partner_rule = cls.env["spp.audit.rule"].search([("model_id", "=", partner_model.id)], limit=1) + name_field = cls.env["ir.model.fields"].search( + [("model_id", "=", partner_model.id), ("name", "=", "name")], limit=1 + ) + rule_vals = { + "is_log_create": True, + "is_log_write": True, + "field_to_log_ids": [Command.link(name_field.id)], + } + if cls.partner_rule: + cls.partner_rule.write(rule_vals) + else: + cls.partner_rule = cls.env["spp.audit.rule"].create( + dict(rule_vals, name="RPC exposure partner rule", model_id=partner_model.id) + ) + + def setUp(self): + super().setUp() + self.temp_dir = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, self.temp_dir, ignore_errors=True) + + def _reset_file_handle(self): + """Drop the file backend's cached handle, which is kept per process.""" + file_backend = type(self.env["spp.audit.backend.file"]) + if file_backend._file_handle is not None: + file_backend._file_handle.close() + file_backend._file_handle = None + + def _audit_lines(self): + lines = [] + for file_name in os.listdir(self.temp_dir): + with open(os.path.join(self.temp_dir, file_name)) as audit_file: + lines.extend(json.loads(line) for line in audit_file if line.strip()) + return lines + + def _assert_not_rpc_callable(self, model, method, args, user): + with self.assertRaises(AccessError) as error: + call_kw(model.with_user(user), method, args, {}) + self.assertIn(PRIVATE_ERROR, str(error.exception)) + + +class TestBackendNotRpcCallable(RpcExposureCommon): + def test_write_entry_refused_for_every_backend(self): + """write_entry is private on every backend, for every user.""" + with patch.dict(os.environ, {"OPENSPP_AUDIT_FILE_PATH": self.temp_dir}): + # Point the file backend at this test's directory + self._reset_file_handle() + self.addCleanup(self._reset_file_handle) + for user in (self.portal_user, self.internal_user, self.audit_manager): + for model_name in BACKEND_MODELS: + with self.subTest(model=model_name, user=user.login): + self._assert_not_rpc_callable(self.env[model_name], "write_entry", [dict(SAMPLE_ENTRY)], user) + self.assertEqual(self._audit_lines(), [], "A refused call must not write to the audit file") + + def test_is_enabled_refused_for_every_backend(self): + """is_enabled is private on every backend.""" + for model_name in BACKEND_MODELS: + with self.subTest(model=model_name): + self._assert_not_rpc_callable(self.env[model_name], "is_enabled", [], self.internal_user) + + +class TestRuleLoggingNotRpcCallable(RpcExposureCommon): + def test_log_refused(self): + """rule.log is private.""" + self._assert_not_rpc_callable( + self.env["spp.audit.rule"], + "log", + [[self.partner_rule.id], "write", [{"id": 1, "name": "Old"}], [{"id": 1, "name": "New"}]], + self.audit_manager, + ) + + def test_log_lifecycle_action_refused(self): + """log_lifecycle_action is private.""" + self._assert_not_rpc_callable( + self.env["spp.audit.rule"], + "log_lifecycle_action", + ["res.partner", 1, "approve", {"state": "draft"}, {"state": "approved"}], + self.audit_manager, + ) + + def test_get_audit_rules_refused(self): + """get_audit_rules is private on the rule model and on audited models.""" + for model_name in ("spp.audit.rule", "res.partner"): + with self.subTest(model=model_name): + self._assert_not_rpc_callable(self.env[model_name], "get_audit_rules", ["write"], self.internal_user) + + +class TestServerSideLoggingStillWorks(RpcExposureCommon): + def test_audited_write_reaches_database_and_file(self): + """A real write still produces its log line in the database and the file backend.""" + partner = self.env["res.partner"].create({"name": "RPC exposure before"}) + log_domain = [("model_id.model", "=", "res.partner"), ("res_id", "=", partner.id), ("method", "=", "write")] + with patch.dict( + os.environ, + { + "OPENSPP_AUDIT_BACKEND_DB": "true", + "OPENSPP_AUDIT_BACKEND_FILE": "true", + "OPENSPP_AUDIT_FILE_PATH": self.temp_dir, + }, + ): + # Start from a file handle pointing at this test's directory + self._reset_file_handle() + self.addCleanup(self._reset_file_handle) + + partner.write({"name": "RPC exposure after"}) + + self.assertEqual(self.env["spp.audit.log"].search_count(log_domain), 1) + written = [ + line for line in self._audit_lines() if line.get("res_id") == partner.id and line.get("method") == "write" + ] + self.assertEqual(len(written), 1) + self.assertEqual(written[0]["data"]["new"]["name"], "RPC exposure after") + + def test_lifecycle_action_still_logs_server_side(self): + """Server code can still record a lifecycle action.""" + partner = self.env["res.partner"].create({"name": "RPC exposure lifecycle"}) + log_domain = [("model_id.model", "=", "res.partner"), ("res_id", "=", partner.id), ("method", "=", "revoke")] + logged = self.env["spp.audit.rule"].log_lifecycle_action( + "res.partner", partner.id, "revoke", {"state": "valid"}, {"state": "revoked"} + ) + self.assertTrue(logged) + self.assertEqual(self.env["spp.audit.log"].search_count(log_domain), 1) From b5e5d5adbddf4cc3ed6f6de723349dac96a2e879 Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Tue, 24 Nov 2026 22:51:49 +0800 Subject: [PATCH 2/6] docs(spp_audit): regenerate README from readme fragments --- spp_audit/README.rst | 8 ++++++++ spp_audit/static/description/index.html | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/spp_audit/README.rst b/spp_audit/README.rst index c9b383a64..505052c51 100644 --- a/spp_audit/README.rst +++ b/spp_audit/README.rst @@ -145,6 +145,14 @@ External Python: ``requests`` (HTTP backend) Changelog ========= +19.0.2.0.3 +~~~~~~~~~~ + +- fix: mark the server-internal audit methods ``@api.private`` — backend + ``write_entry`` / ``is_enabled`` and the rule's ``log``, + ``log_lifecycle_action``, ``get_audit_rules``; server-side callers are + unaffected + 19.0.2.0.2 ~~~~~~~~~~ diff --git a/spp_audit/static/description/index.html b/spp_audit/static/description/index.html index 54fdc44ba..8be097693 100644 --- a/spp_audit/static/description/index.html +++ b/spp_audit/static/description/index.html @@ -516,6 +516,15 @@

Changelog

+

19.0.2.0.3

+
    +
  • fix: mark the server-internal audit methods @api.private — backend +write_entry / is_enabled and the rule’s log, +log_lifecycle_action, get_audit_rules; server-side callers are +unaffected
  • +
+
+

19.0.2.0.2

  • feat: audit_disable context key lets trusted machine flows (e.g. @@ -529,7 +538,7 @@

    19.0.2.0.2

    per-record searches) on every create/write of an audited model
-
+

19.0.2.0.1

  • fix: use @api.model_create_multi for audit_create to support Odoo 19 @@ -542,7 +551,7 @@

    19.0.2.0.1

    parent_data_html fields to prevent stored XSS (#50)
-
+

19.0.2.0.0

  • Initial migration to OpenSPP2
  • From 9727ba201b1c2212ea2d1c51fb9116d9b7c98190 Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Tue, 24 Nov 2026 23:25:11 +0800 Subject: [PATCH 3/6] fix(spp_audit): recognise audit context flags only when set by server code audit_disable and audit_in_progress are now matched by identity against marker objects defined in spp_audit, instead of by truthiness. Trusted flows pass spp_audit.tools.AUDIT_DISABLE; a plain value is ignored and the operation is audited. --- spp_audit/__manifest__.py | 2 +- spp_audit/readme/HISTORY.md | 4 ++ spp_audit/tests/__init__.py | 1 + spp_audit/tests/test_audit_disable.py | 10 ++- spp_audit/tests/test_context_flags.py | 99 ++++++++++++++++++++++++++ spp_audit/tests/test_spp_audit_rule.py | 4 +- spp_audit/tools/__init__.py | 2 +- spp_audit/tools/decorator.py | 43 +++++++++-- 8 files changed, 154 insertions(+), 11 deletions(-) create mode 100644 spp_audit/tests/test_context_flags.py diff --git a/spp_audit/__manifest__.py b/spp_audit/__manifest__.py index ff882d7bc..6b43ba9aa 100644 --- a/spp_audit/__manifest__.py +++ b/spp_audit/__manifest__.py @@ -3,7 +3,7 @@ "name": "OpenSPP Audit", "summary": "Comprehensively tracks all data modifications and user actions across the OpenSPP platform, recording old and new values for configured data. It enhances accountability and data integrity by maintaining an immutable history of changes, crucial for internal audits, compliance, and detecting unauthorized alterations. Supports multiple backends (database, file, syslog, HTTP) with tamper-resistant configuration.", "category": "OpenSPP/Monitoring", - "version": "19.0.2.0.3", + "version": "19.0.2.0.4", "sequence": 1, "author": "OpenSPP.org", "website": "https://github.com/OpenSPP/OpenSPP2", diff --git a/spp_audit/readme/HISTORY.md b/spp_audit/readme/HISTORY.md index d200195cc..495528519 100644 --- a/spp_audit/readme/HISTORY.md +++ b/spp_audit/readme/HISTORY.md @@ -1,3 +1,7 @@ +### 19.0.2.0.4 + +- fix: `audit_disable` is honoured only when server-side code sets it to the `AUDIT_DISABLE` marker (`from odoo.addons.spp_audit.tools import AUDIT_DISABLE`; `records.with_context(audit_disable=AUDIT_DISABLE)`). A plain value such as `True` no longer skips audit logging, so flows that relied on it are audited again until they pass the marker. `audit_in_progress` is likewise recognised only when set by the audit decorator itself + ### 19.0.2.0.3 - fix: mark the server-internal audit methods `@api.private` — backend `write_entry` / `is_enabled` and the rule's `log`, `log_lifecycle_action`, `get_audit_rules`; server-side callers are unaffected diff --git a/spp_audit/tests/__init__.py b/spp_audit/tests/__init__.py index bbd45ecb8..c4c2a30bd 100644 --- a/spp_audit/tests/__init__.py +++ b/spp_audit/tests/__init__.py @@ -1,5 +1,6 @@ from . import test_audit_backend from . import test_audit_disable +from . import test_context_flags from . import test_html_escaping from . import test_rpc_exposure from . import test_spp_audit_rule diff --git a/spp_audit/tests/test_audit_disable.py b/spp_audit/tests/test_audit_disable.py index 1824074ad..b396dc82e 100644 --- a/spp_audit/tests/test_audit_disable.py +++ b/spp_audit/tests/test_audit_disable.py @@ -3,6 +3,8 @@ from odoo import Command from odoo.tests.common import TransactionCase +from ..tools import AUDIT_DISABLE + class AuditDisableCommon(TransactionCase): """Shared fixture: a res.partner audit rule with all methods logged.""" @@ -57,7 +59,9 @@ class TestAuditDisableContext(AuditDisableCommon): def test_create_bypassed(self): patcher, reads = self._classic_write_read_spy() with patcher: - partner = self.env["res.partner"].with_context(audit_disable=True).create({"name": "Disable Create"}) + partner = ( + self.env["res.partner"].with_context(audit_disable=AUDIT_DISABLE).create({"name": "Disable Create"}) + ) self.assertTrue(partner.exists()) self.assertFalse(self._logs(partner, "create")) self.assertFalse(reads, "audit_disable must skip the full-record snapshot read on create") @@ -66,7 +70,7 @@ def test_write_bypassed(self): partner = self.env["res.partner"].create({"name": "Disable Write"}) patcher, reads = self._classic_write_read_spy() with patcher: - partner.with_context(audit_disable=True).write({"name": "Disable Write Changed"}) + partner.with_context(audit_disable=AUDIT_DISABLE).write({"name": "Disable Write Changed"}) self.assertEqual(partner.name, "Disable Write Changed") self.assertFalse(self._logs(partner, "write")) self.assertFalse(reads, "audit_disable must skip the full-record snapshot reads on write") @@ -76,7 +80,7 @@ def test_unlink_bypassed(self): partner_id = partner.id patcher, reads = self._classic_write_read_spy() with patcher: - partner.with_context(audit_disable=True).unlink() + partner.with_context(audit_disable=AUDIT_DISABLE).unlink() self.assertFalse(partner.exists()) self.assertFalse( self._logs(self.env["res.partner"].browse(partner_id), "unlink"), diff --git a/spp_audit/tests/test_context_flags.py b/spp_audit/tests/test_context_flags.py new file mode 100644 index 000000000..e2124a4ce --- /dev/null +++ b/spp_audit/tests/test_context_flags.py @@ -0,0 +1,99 @@ +"""The audit decorator's context flags are for server-side code only. + +A plain value in the context, such as one sent by an RPC client, does not +change what is audited. +""" + +import json + +from odoo.service.model import call_kw +from odoo.tests.common import new_test_user + +from ..tools import AUDIT_DISABLE +from .test_audit_disable import AuditDisableCommon + +PLAIN_DISABLE_FLAGS = [ + {"audit_disable": True}, + {"audit_disable": "audit_disable"}, +] +# audit_in_progress is only read on write +PLAIN_FLAGS = PLAIN_DISABLE_FLAGS + [ + {"audit_in_progress": True}, + {"audit_in_progress": "audit_in_progress"}, +] + + +class TestPlainContextFlagsStillAudited(AuditDisableCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.user = new_test_user( + cls.env, + login="audit_context_flags_user", + groups="base.group_user,base.group_partner_manager", + ) + + def _partner_model(self): + return self.env["res.partner"].with_user(self.user) + + def test_rpc_create_is_logged(self): + for flags in PLAIN_DISABLE_FLAGS: + with self.subTest(context=flags): + partner_id = call_kw(self._partner_model(), "create", [{"name": "Flag Create"}], {"context": flags}) + self.assertTrue(self._logs(self.env["res.partner"].browse(partner_id), "create")) + + def test_rpc_write_is_logged(self): + for flags in PLAIN_FLAGS: + with self.subTest(context=flags): + partner = self.env["res.partner"].create({"name": "Flag Write"}) + call_kw( + self._partner_model(), "write", [[partner.id], {"name": "Flag Write Changed"}], {"context": flags} + ) + self.assertEqual(len(self._logs(partner, "write")), 1) + + def test_rpc_unlink_is_logged(self): + for flags in PLAIN_DISABLE_FLAGS: + with self.subTest(context=flags): + partner = self.env["res.partner"].create({"name": "Flag Unlink"}) + call_kw(self._partner_model(), "unlink", [[partner.id]], {"context": flags}) + self.assertFalse(partner.exists()) + self.assertTrue(self._logs(partner, "unlink")) + + def test_server_side_plain_value_is_logged(self): + for flags in PLAIN_FLAGS: + with self.subTest(context=flags): + partner = self.env["res.partner"].create({"name": "Flag Server"}) + partner.with_context(**flags).write({"name": "Flag Server Changed"}) + self.assertEqual(len(self._logs(partner, "write")), 1) + + def test_server_side_plain_value_create_is_logged(self): + for flags in PLAIN_DISABLE_FLAGS: + with self.subTest(context=flags): + partner = self.env["res.partner"].with_context(**flags).create({"name": "Flag Server Create"}) + self.assertTrue(self._logs(partner, "create")) + + +class TestContextMarker(AuditDisableCommon): + def test_marker_does_not_equal_its_text(self): + self.assertNotEqual(AUDIT_DISABLE, "audit_disable") + self.assertNotEqual("audit_disable", AUDIT_DISABLE) + self.assertNotEqual({"audit_disable": "audit_disable"}, {"audit_disable": AUDIT_DISABLE}) + + def test_marker_serialises(self): + self.assertEqual(json.dumps({"audit_disable": AUDIT_DISABLE}), '{"audit_disable": "audit_disable"}') + + def test_plain_text_after_marker_is_logged(self): + """A context holding the marker's text does not reuse the marker's environment.""" + partner = self.env["res.partner"].create({"name": "Marker Then Text"}) + partner.with_context(audit_disable=AUDIT_DISABLE).write({"name": "Marker Write"}) + self.assertFalse(self._logs(partner, "write")) + partner.with_context(audit_disable="audit_disable").write({"name": "Text Write"}) + self.assertEqual(len(self._logs(partner, "write")), 1) + + def test_marker_after_plain_text_still_disables(self): + """A context holding the marker does not reuse the environment of one holding its text.""" + partner = self.env["res.partner"].create({"name": "Text Then Marker"}) + partner.with_context(audit_disable="audit_disable").write({"name": "Text Write"}) + self.assertEqual(len(self._logs(partner, "write")), 1) + partner.with_context(audit_disable=AUDIT_DISABLE).write({"name": "Marker Write"}) + self.assertEqual(len(self._logs(partner, "write")), 1) diff --git a/spp_audit/tests/test_spp_audit_rule.py b/spp_audit/tests/test_spp_audit_rule.py index 05c2f5161..d639183ac 100644 --- a/spp_audit/tests/test_spp_audit_rule.py +++ b/spp_audit/tests/test_spp_audit_rule.py @@ -1,5 +1,7 @@ from odoo.tests.common import TransactionCase +from ..tools.decorator import _AUDIT_IN_PROGRESS + class AuditRuleTest(TransactionCase): """Tests for spp.audit.rule core functionality.""" @@ -252,7 +254,7 @@ def test_write_no_recursive_audit(self): ) # Write with audit_in_progress flag — should skip audit logging - partner.with_context(audit_in_progress=True).write({"name": "Skipped"}) + partner.with_context(audit_in_progress=_AUDIT_IN_PROGRESS).write({"name": "Skipped"}) log_count_after = self.env["spp.audit.log"].search_count( [ diff --git a/spp_audit/tools/__init__.py b/spp_audit/tools/__init__.py index b1eab6038..ab3045e01 100644 --- a/spp_audit/tools/__init__.py +++ b/spp_audit/tools/__init__.py @@ -1,2 +1,2 @@ from .config import AuditConfig -from .decorator import audit_decorator +from .decorator import AUDIT_DISABLE, audit_decorator diff --git a/spp_audit/tools/decorator.py b/spp_audit/tools/decorator.py index 5eaeee68b..c0186527b 100644 --- a/spp_audit/tools/decorator.py +++ b/spp_audit/tools/decorator.py @@ -11,6 +11,39 @@ _logger = logging.getLogger(__name__) +class _ContextMarker(str): + """Context value that the audit decorator recognises by identity. + + A context can be supplied by an RPC client, so a plain value such as + ``True`` proves nothing about who set it. A marker is an object that only + server-side Python code can put in the context: a value that arrives over + RPC is never the same object. It is a ``str`` so that a context holding it + can still be serialised. + + Equality is identity too. Odoo reuses an environment whose context + compares equal, so a marker that equalled its own text would let a context + holding that plain text stand in for one holding the marker. + """ + + __slots__ = () + + def __eq__(self, other): + return self is other + + def __ne__(self, other): + return self is not other + + __hash__ = str.__hash__ + + +# Trusted server-side flows pass this as the ``audit_disable`` context value +# to skip audit logging: ``records.with_context(audit_disable=AUDIT_DISABLE)``. +AUDIT_DISABLE = _ContextMarker("audit_disable") + +# Set by audit_write itself as the ``audit_in_progress`` context value. +_AUDIT_IN_PROGRESS = _ContextMarker("audit_in_progress") + + def _stringify_markup(values): """Convert Markup field values to plain str in read() result dicts.""" for rec_values in values or []: @@ -35,7 +68,7 @@ def audit_create(self, vals_list): # audit_disable: trusted machine flows (e.g. replication of records # already audited at their source) opt out of audit logging and its # full-record snapshot reads. - if self.env.context.get("audit_disable"): + if self.env.context.get("audit_disable") is AUDIT_DISABLE: return audit_create.origin(self, vals_list) result = audit_create.origin(self, vals_list) records = result @@ -60,10 +93,10 @@ def audit_create(self, vals_list): def audit_write(self, vals): # audit_disable: trusted machine flows opt out entirely (see audit_create) - if self.env.context.get("audit_disable"): + if self.env.context.get("audit_disable") is AUDIT_DISABLE: return audit_write.origin(self, vals) # Prevent recursive audit logging from computed field updates - if self.env.context.get("audit_in_progress"): + if self.env.context.get("audit_in_progress") is _AUDIT_IN_PROGRESS: return audit_write.origin(self, vals) rules = self.get_audit_rules("write") @@ -79,7 +112,7 @@ def audit_write(self, vals): old_values_copy = copy.deepcopy(old_values) # Set flag to prevent recursive auditing - result = audit_write.origin(self.with_context(audit_in_progress=True), vals) + result = audit_write.origin(self.with_context(audit_in_progress=_AUDIT_IN_PROGRESS), vals) if not rules: # No matching rule: skip the post-write snapshot read too — it @@ -101,7 +134,7 @@ def audit_write(self, vals): def audit_unlink(self): # audit_disable: trusted machine flows opt out entirely (see audit_create) - if self.env.context.get("audit_disable"): + if self.env.context.get("audit_disable") is AUDIT_DISABLE: return audit_unlink.origin(self) rules = self.get_audit_rules("unlink") if not rules: From 97d8dd69a62f0e8d3326f0567ba8db8caf74a280 Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Tue, 24 Nov 2026 23:40:12 +0800 Subject: [PATCH 4/6] fix(spp_audit): audit writes nested inside an audited write The in-progress guard covered every model and record for the duration of the original write, so a nested write to another record was not audited. Track the records being audited on the cursor and skip a nested write for those records only. --- spp_audit/readme/HISTORY.md | 3 +- spp_audit/tests/test_context_flags.py | 84 +++++++++++++++++++++++++- spp_audit/tests/test_spp_audit_rule.py | 13 ++-- spp_audit/tools/decorator.py | 61 +++++++++++-------- 4 files changed, 130 insertions(+), 31 deletions(-) diff --git a/spp_audit/readme/HISTORY.md b/spp_audit/readme/HISTORY.md index 495528519..716b0cb53 100644 --- a/spp_audit/readme/HISTORY.md +++ b/spp_audit/readme/HISTORY.md @@ -1,6 +1,7 @@ ### 19.0.2.0.4 -- fix: `audit_disable` is honoured only when server-side code sets it to the `AUDIT_DISABLE` marker (`from odoo.addons.spp_audit.tools import AUDIT_DISABLE`; `records.with_context(audit_disable=AUDIT_DISABLE)`). A plain value such as `True` no longer skips audit logging, so flows that relied on it are audited again until they pass the marker. `audit_in_progress` is likewise recognised only when set by the audit decorator itself +- fix: `audit_disable` is honoured only when server-side code sets it to the `AUDIT_DISABLE` marker (`from odoo.addons.spp_audit.tools import AUDIT_DISABLE`; `records.with_context(audit_disable=AUDIT_DISABLE)`). A plain value such as `True` no longer skips audit logging, so flows that relied on it are audited again until they pass the marker. +- fix: a write made inside an audited write is now audited when it touches other records (for example a child record updated through its parent's one2many field, or values synced to related records). Only the records already being audited by the enclosing write are skipped, so the same change is not logged twice. Expect more audit log rows for such writes. The `audit_in_progress` context key is no longer read ### 19.0.2.0.3 diff --git a/spp_audit/tests/test_context_flags.py b/spp_audit/tests/test_context_flags.py index e2124a4ce..a1df2b0b3 100644 --- a/spp_audit/tests/test_context_flags.py +++ b/spp_audit/tests/test_context_flags.py @@ -5,18 +5,21 @@ """ import json +from unittest.mock import patch +from odoo import Command from odoo.service.model import call_kw from odoo.tests.common import new_test_user from ..tools import AUDIT_DISABLE +from ..tools.decorator import _writes_in_progress from .test_audit_disable import AuditDisableCommon PLAIN_DISABLE_FLAGS = [ {"audit_disable": True}, {"audit_disable": "audit_disable"}, ] -# audit_in_progress is only read on write +# audit_in_progress is not read by the decorator; a client may still send it PLAIN_FLAGS = PLAIN_DISABLE_FLAGS + [ {"audit_in_progress": True}, {"audit_in_progress": "audit_in_progress"}, @@ -97,3 +100,82 @@ def test_marker_after_plain_text_still_disables(self): self.assertEqual(len(self._logs(partner, "write")), 1) partner.with_context(audit_disable=AUDIT_DISABLE).write({"name": "Marker Write"}) self.assertEqual(len(self._logs(partner, "write")), 1) + + +class TestNestedWritesAudited(AuditDisableCommon): + """A write made inside an audited write is audited when it touches other records.""" + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.user = new_test_user( + cls.env, + login="audit_nested_write_user", + groups="base.group_user,base.group_partner_manager", + ) + + def test_child_updated_through_parent_is_logged(self): + parent = self.env["res.partner"].create({"name": "Nested Parent", "is_company": True}) + child = self.env["res.partner"].create({"name": "Nested Child", "parent_id": parent.id}) + call_kw( + self.env["res.partner"].with_user(self.user), + "write", + [[parent.id], {"child_ids": [Command.update(child.id, {"name": "Nested Child Changed"})]}], + {}, + ) + self.assertEqual(child.name, "Nested Child Changed") + self.assertEqual(len(self._logs(child, "write")), 1) + + def test_parent_and_child_each_logged_once(self): + parent = self.env["res.partner"].create({"name": "Both Parent", "is_company": True}) + child = self.env["res.partner"].create({"name": "Both Child", "parent_id": parent.id}) + parent.write( + {"name": "Both Parent Changed", "child_ids": [Command.update(child.id, {"name": "Both Child Changed"})]} + ) + self.assertEqual(len(self._logs(parent, "write")), 1) + self.assertEqual(len(self._logs(child, "write")), 1) + + def test_write_in_progress_for_another_record_does_not_skip(self): + covered = self.env["res.partner"].create({"name": "Covered"}) + other = self.env["res.partner"].create({"name": "Other"}) + in_progress = _writes_in_progress(self.env) + in_progress.add(("res.partner", covered.id)) + self.addCleanup(in_progress.clear) + (covered | other).write({"name": "Written Together"}) + self.assertFalse(self._logs(covered, "write")) + self.assertEqual(len(self._logs(other, "write")), 1) + + def test_nested_write_to_same_record_is_logged_once(self): + """The original write runs with its records marked, so a nested write to them is not logged again.""" + partner = self.env["res.partner"].create({"name": "Same Record"}) + audit_write = type(partner).write + real_origin = audit_write.origin + seen = [] + + def spy(records, vals): + seen.append(set(_writes_in_progress(records.env))) + if len(seen) == 1: + # A write to the same record, on an audited field, from inside the original write + records.write({"name": "Same Record Nested"}) + return real_origin(records, vals) + + with patch.object(audit_write, "origin", spy): + partner.write({"name": "Same Record Changed"}) + + self.assertIn(("res.partner", partner.id), seen[0]) + self.assertEqual(len(self._logs(partner, "write")), 1) + self.assertFalse(_writes_in_progress(self.env)) + + def test_failed_write_leaves_nothing_in_progress(self): + partner = self.env["res.partner"].create({"name": "Failing Write"}) + audit_write = type(partner).write + + def failing(records, vals): + raise RuntimeError("write failed") + + with patch.object(audit_write, "origin", failing), self.assertRaises(RuntimeError): + partner.write({"name": "Never Written"}) + + self.assertFalse(_writes_in_progress(self.env)) + partner.write({"name": "Written After Failure"}) + self.assertEqual(len(self._logs(partner, "write")), 1) diff --git a/spp_audit/tests/test_spp_audit_rule.py b/spp_audit/tests/test_spp_audit_rule.py index d639183ac..7aaf93df1 100644 --- a/spp_audit/tests/test_spp_audit_rule.py +++ b/spp_audit/tests/test_spp_audit_rule.py @@ -1,6 +1,6 @@ from odoo.tests.common import TransactionCase -from ..tools.decorator import _AUDIT_IN_PROGRESS +from ..tools.decorator import _writes_in_progress class AuditRuleTest(TransactionCase): @@ -241,7 +241,7 @@ def test_write_multiple_records(self): self.assertIn(partner.id, logged_ids) def test_write_no_recursive_audit(self): - """Write with audit_in_progress context should not create duplicate logs.""" + """A write nested in an audited write of the same record should not create duplicate logs.""" partner = self.env["res.partner"].create({"name": "Recurse Test"}) # Count logs before @@ -253,8 +253,11 @@ def test_write_no_recursive_audit(self): ] ) - # Write with audit_in_progress flag — should skip audit logging - partner.with_context(audit_in_progress=_AUDIT_IN_PROGRESS).write({"name": "Skipped"}) + # Write while the record's write is already being audited — should skip audit logging + in_progress = _writes_in_progress(self.env) + in_progress.add(("res.partner", partner.id)) + self.addCleanup(in_progress.clear) + partner.write({"name": "Skipped"}) log_count_after = self.env["spp.audit.log"].search_count( [ @@ -266,7 +269,7 @@ def test_write_no_recursive_audit(self): self.assertEqual( log_count_before, log_count_after, - "audit_in_progress context should prevent audit logging", + "a write already being audited should not be logged again", ) diff --git a/spp_audit/tools/decorator.py b/spp_audit/tools/decorator.py index c0186527b..b0ef099b1 100644 --- a/spp_audit/tools/decorator.py +++ b/spp_audit/tools/decorator.py @@ -40,8 +40,21 @@ def __ne__(self, other): # to skip audit logging: ``records.with_context(audit_disable=AUDIT_DISABLE)``. AUDIT_DISABLE = _ContextMarker("audit_disable") -# Set by audit_write itself as the ``audit_in_progress`` context value. -_AUDIT_IN_PROGRESS = _ContextMarker("audit_in_progress") + +# Key in the cursor's cache for the records whose write is being audited. +_WRITE_IN_PROGRESS = "spp_audit_write_in_progress" + + +def _writes_in_progress(env): + """Return the ``(model name, record id)`` pairs whose write is being audited. + + The set lives on the cursor, not in the context, so a caller cannot supply + it and it is shared by every environment of the transaction. A write + nested inside an audited write is skipped for those records only: the + enclosing write already logs their change, and writes to any other record + are still audited. + """ + return env.cr.cache.setdefault(_WRITE_IN_PROGRESS, set()) def _stringify_markup(values): @@ -95,33 +108,33 @@ def audit_write(self, vals): # audit_disable: trusted machine flows opt out entirely (see audit_create) if self.env.context.get("audit_disable") is AUDIT_DISABLE: return audit_write.origin(self, vals) - # Prevent recursive audit logging from computed field updates - if self.env.context.get("audit_in_progress") is _AUDIT_IN_PROGRESS: + # Records already being audited by an enclosing audit_write are left to it + in_progress = _writes_in_progress(self.env) + records = self.filtered(lambda record: (record._name, record.id) not in in_progress) + rules = self.get_audit_rules("write") if records else None + if not rules: + # Nothing left to audit, or no matching rule: skip the snapshot + # reads, which evaluate every non-stored compute on the records. return audit_write.origin(self, vals) - rules = self.get_audit_rules("write") - old_values_copy = None - if rules: - # Use sudo() to take a full snapshot of record values for auditing, - # regardless of user field-level access; audit rules control exposure. - old_values = ( - self.sudo() # nosemgrep: odoo-sudo-without-context - .with_context(allowed_company_ids=[]) - .read(load="_classic_write") - ) - old_values_copy = copy.deepcopy(old_values) - - # Set flag to prevent recursive auditing - result = audit_write.origin(self.with_context(audit_in_progress=_AUDIT_IN_PROGRESS), vals) + # Use sudo() to take a full snapshot of record values for auditing, + # regardless of user field-level access; audit rules control exposure. + old_values = ( + records.sudo() # nosemgrep: odoo-sudo-without-context + .with_context(allowed_company_ids=[]) + .read(load="_classic_write") + ) + old_values_copy = copy.deepcopy(old_values) - if not rules: - # No matching rule: skip the post-write snapshot read too — it - # previously ran unconditionally, evaluating every non-stored - # compute on every write of an audited model. - return result + auditing = {(records._name, record_id) for record_id in records.ids} + in_progress |= auditing + try: + result = audit_write.origin(self, vals) + finally: + in_progress -= auditing new_values = ( - self.sudo() # nosemgrep: odoo-sudo-without-context + records.sudo() # nosemgrep: odoo-sudo-without-context .with_context(allowed_company_ids=[]) .read(load="_classic_write") ) From 90766c92db13a6152e9519e7752c2cb7d5493eb7 Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Tue, 24 Nov 2026 23:56:09 +0800 Subject: [PATCH 5/6] test(spp_audit): cover failed writes and marker copies Check the in-progress records are released when the write fails without relying on assertRaises, and that copying a context keeps the marker. --- spp_audit/readme/HISTORY.md | 2 +- spp_audit/tests/test_context_flags.py | 17 +++++++++++++++-- spp_audit/tools/decorator.py | 12 +++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/spp_audit/readme/HISTORY.md b/spp_audit/readme/HISTORY.md index 716b0cb53..262eae8fb 100644 --- a/spp_audit/readme/HISTORY.md +++ b/spp_audit/readme/HISTORY.md @@ -1,7 +1,7 @@ ### 19.0.2.0.4 - fix: `audit_disable` is honoured only when server-side code sets it to the `AUDIT_DISABLE` marker (`from odoo.addons.spp_audit.tools import AUDIT_DISABLE`; `records.with_context(audit_disable=AUDIT_DISABLE)`). A plain value such as `True` no longer skips audit logging, so flows that relied on it are audited again until they pass the marker. -- fix: a write made inside an audited write is now audited when it touches other records (for example a child record updated through its parent's one2many field, or values synced to related records). Only the records already being audited by the enclosing write are skipped, so the same change is not logged twice. Expect more audit log rows for such writes. The `audit_in_progress` context key is no longer read +- fix: a write made inside an audited write is now audited when it touches other records (for example a child record updated through its parent's one2many field, or values synced to related records). Only the records already being audited by the enclosing write are skipped, so the same change is not logged twice. Expect more audit log rows for such writes. The `audit_in_progress` context key is no longer read. ### 19.0.2.0.3 diff --git a/spp_audit/tests/test_context_flags.py b/spp_audit/tests/test_context_flags.py index a1df2b0b3..85fddeda0 100644 --- a/spp_audit/tests/test_context_flags.py +++ b/spp_audit/tests/test_context_flags.py @@ -4,7 +4,9 @@ change what is audited. """ +import copy import json +import pickle from unittest.mock import patch from odoo import Command @@ -82,6 +84,11 @@ def test_marker_does_not_equal_its_text(self): self.assertNotEqual("audit_disable", AUDIT_DISABLE) self.assertNotEqual({"audit_disable": "audit_disable"}, {"audit_disable": AUDIT_DISABLE}) + def test_marker_survives_copy(self): + context = {"audit_disable": AUDIT_DISABLE} + self.assertIs(copy.deepcopy(context)["audit_disable"], AUDIT_DISABLE) + self.assertIs(pickle.loads(pickle.dumps(AUDIT_DISABLE)), AUDIT_DISABLE) + def test_marker_serialises(self): self.assertEqual(json.dumps({"audit_disable": AUDIT_DISABLE}), '{"audit_disable": "audit_disable"}') @@ -173,9 +180,15 @@ def test_failed_write_leaves_nothing_in_progress(self): def failing(records, vals): raise RuntimeError("write failed") - with patch.object(audit_write, "origin", failing), self.assertRaises(RuntimeError): - partner.write({"name": "Never Written"}) + # Not assertRaises: it rolls back a savepoint, which clears the cursor's cache + raised = False + with patch.object(audit_write, "origin", failing): + try: + partner.write({"name": "Never Written"}) + except RuntimeError: + raised = True + self.assertTrue(raised) self.assertFalse(_writes_in_progress(self.env)) partner.write({"name": "Written After Failure"}) self.assertEqual(len(self._logs(partner, "write")), 1) diff --git a/spp_audit/tools/decorator.py b/spp_audit/tools/decorator.py index b0ef099b1..fcb1bcadb 100644 --- a/spp_audit/tools/decorator.py +++ b/spp_audit/tools/decorator.py @@ -35,6 +35,10 @@ def __ne__(self, other): __hash__ = str.__hash__ + def __reduce__(self): + # copy, deepcopy and pickle give back the module-level marker itself + return "AUDIT_DISABLE" + # Trusted server-side flows pass this as the ``audit_disable`` context value # to skip audit logging: ``records.with_context(audit_disable=AUDIT_DISABLE)``. @@ -53,6 +57,10 @@ def _writes_in_progress(env): nested inside an audited write is skipped for those records only: the enclosing write already logs their change, and writes to any other record are still audited. + + Odoo clears the cursor's cache on commit, rollback and savepoint rollback. + If that happens during a write, a later nested write to the same records + is logged again: the guard fails towards more logging, never less. """ return env.cr.cache.setdefault(_WRITE_IN_PROGRESS, set()) @@ -110,7 +118,9 @@ def audit_write(self, vals): return audit_write.origin(self, vals) # Records already being audited by an enclosing audit_write are left to it in_progress = _writes_in_progress(self.env) - records = self.filtered(lambda record: (record._name, record.id) not in in_progress) + records = self + if in_progress: + records = self.filtered(lambda record: (record._name, record.id) not in in_progress) rules = self.get_audit_rules("write") if records else None if not rules: # Nothing left to audit, or no matching rule: skip the snapshot From afa37cce6f520246097a5a320f4167455305e181 Mon Sep 17 00:00:00 2001 From: Edwin Gonzales Date: Wed, 25 Nov 2026 00:10:55 +0800 Subject: [PATCH 6/6] docs(spp_audit): regenerate README from readme fragments --- spp_audit/README.rst | 16 ++++++++++++++++ spp_audit/static/description/index.html | 23 ++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/spp_audit/README.rst b/spp_audit/README.rst index 505052c51..471dbb673 100644 --- a/spp_audit/README.rst +++ b/spp_audit/README.rst @@ -145,6 +145,22 @@ External Python: ``requests`` (HTTP backend) Changelog ========= +19.0.2.0.4 +~~~~~~~~~~ + +- fix: ``audit_disable`` is honoured only when server-side code sets it + to the ``AUDIT_DISABLE`` marker + (``from odoo.addons.spp_audit.tools import AUDIT_DISABLE``; + ``records.with_context(audit_disable=AUDIT_DISABLE)``). A plain value + such as ``True`` no longer skips audit logging, so flows that relied + on it are audited again until they pass the marker. +- fix: a write made inside an audited write is now audited when it + touches other records (for example a child record updated through its + parent's one2many field, or values synced to related records). Only + the records already being audited by the enclosing write are skipped, + so the same change is not logged twice. Expect more audit log rows for + such writes. The ``audit_in_progress`` context key is no longer read. + 19.0.2.0.3 ~~~~~~~~~~ diff --git a/spp_audit/static/description/index.html b/spp_audit/static/description/index.html index 8be097693..2a2682555 100644 --- a/spp_audit/static/description/index.html +++ b/spp_audit/static/description/index.html @@ -516,6 +516,23 @@

    Changelog

+

19.0.2.0.4

+
    +
  • fix: audit_disable is honoured only when server-side code sets it +to the AUDIT_DISABLE marker +(from odoo.addons.spp_audit.tools import AUDIT_DISABLE; +records.with_context(audit_disable=AUDIT_DISABLE)). A plain value +such as True no longer skips audit logging, so flows that relied +on it are audited again until they pass the marker.
  • +
  • fix: a write made inside an audited write is now audited when it +touches other records (for example a child record updated through its +parent’s one2many field, or values synced to related records). Only +the records already being audited by the enclosing write are skipped, +so the same change is not logged twice. Expect more audit log rows for +such writes. The audit_in_progress context key is no longer read.
  • +
+
+

19.0.2.0.3

  • fix: mark the server-internal audit methods @api.private — backend @@ -524,7 +541,7 @@

    19.0.2.0.3

    unaffected
-
+

19.0.2.0.2

  • feat: audit_disable context key lets trusted machine flows (e.g. @@ -538,7 +555,7 @@

    19.0.2.0.2

    per-record searches) on every create/write of an audited model
-
+

19.0.2.0.1

  • fix: use @api.model_create_multi for audit_create to support Odoo 19 @@ -551,7 +568,7 @@

    19.0.2.0.1

    parent_data_html fields to prevent stored XSS (#50)
-
+

19.0.2.0.0

  • Initial migration to OpenSPP2