diff --git a/README.md b/README.md index 5bf93cea150..65f1eb90fc9 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Available addons addon | version | maintainers | summary --- | --- | --- | --- [attachment_unindex_content](attachment_unindex_content/) | 19.0.1.0.0 | moylop260 ebirbe luisg123v | Disable indexing of attachments -[auditlog](auditlog/) | 19.0.2.0.0 | | Audit Log +[auditlog](auditlog/) | 19.0.2.0.1 | | Audit Log [auto_backup](auto_backup/) | 19.0.1.0.1 | | Backups database [base_cron_exclusion](base_cron_exclusion/) | 19.0.1.0.0 | LoisRForgeFlow | Allow you to select scheduled actions that should not run simultaneously. [base_exception](base_exception/) | 19.0.1.0.0 | hparfr sebastienbeau | This module provide an abstract model to manage customizable exceptions to be applied on different models (sale order, invoice, ...) diff --git a/auditlog/README.rst b/auditlog/README.rst index 70aed989a25..20fb5f1f8e9 100644 --- a/auditlog/README.rst +++ b/auditlog/README.rst @@ -11,7 +11,7 @@ Audit Log !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:3db0314c73f17e5c63ecb5205a4d29beff97812aca664e1dd624646702f14bee + !! source digest: sha256:620a80526b6f2d225f81287c03ac63b2c4b5f56fe19e2b833b6f2d31b015c093 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/auditlog/__manifest__.py b/auditlog/__manifest__.py index cd1ffd914dc..48fbbc40ea4 100644 --- a/auditlog/__manifest__.py +++ b/auditlog/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Audit Log", - "version": "19.0.2.0.0", + "version": "19.0.2.0.1", "author": "ABF OSIELL, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/server-tools", diff --git a/auditlog/models/auditlog_rule.py b/auditlog/models/auditlog_rule.py index 137cf766938..dacca8ec54c 100644 --- a/auditlog/models/auditlog_rule.py +++ b/auditlog/models/auditlog_rule.py @@ -243,7 +243,7 @@ def _register_hook(self): def _patch_method(self, model, method_name, check_attr): result = new_method = False - model_class = type(model) + model_class = model.env.registry[model._name] if method_name == "create": new_method = self._make_create() elif method_name == "read": @@ -257,7 +257,7 @@ def _patch_method(self, model, method_name, check_attr): if new_method: new_method.origin = getattr(model_class, method_name) setattr(model_class, method_name, new_method) - setattr(type(model), check_attr, True) + setattr(model_class, check_attr, True) result = True return result @@ -300,15 +300,13 @@ def _revert_methods(self): """Restore original ORM methods of models defined in rules.""" updated = False for rule in self: - model_model = self.env[rule.model_id.model or rule.model_model] + model_class = self.env.registry[rule.model_id.model or rule.model_model] for method in ["create", "read", "write", "unlink", "export_data"]: if getattr(rule, f"log_{method}") and hasattr( - getattr(model_model, method), "origin" + getattr(model_class, method), "origin" ): - setattr( - type(model_model), method, getattr(model_model, method).origin - ) - delattr(type(model_model), f"auditlog_ruled_{method}") + delattr(model_class, method) + delattr(model_class, f"auditlog_ruled_{method}") updated = True if updated: self._update_registry() diff --git a/auditlog/static/description/index.html b/auditlog/static/description/index.html index c2472e1cabf..dc34b219e22 100644 --- a/auditlog/static/description/index.html +++ b/auditlog/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Audit Log