Maintainers
+Maintainers
This module is maintained by the OCA.
@@ -456,5 +461,6 @@ diff --git a/README.md b/README.md
index 744c6a56d6f..e3fbeea03d2 100644
--- a/README.md
+++ b/README.md
@@ -22,28 +22,28 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[attachment_delete_restrict](attachment_delete_restrict/) | 18.0.1.0.0 |
| Restrict Deletion of Attachments
-[attachment_queue](attachment_queue/) | 18.0.1.0.0 |
| Base module adding the concept of queue for processing files
+[attachment_queue](attachment_queue/) | 18.0.1.0.1 |
| Base module adding the concept of queue for processing files
[attachment_synchronize](attachment_synchronize/) | 18.0.1.0.0 |
| Attachment Synchronize
[attachment_unindex_content](attachment_unindex_content/) | 18.0.1.0.0 |
| Disable indexing of attachments
-[auditlog](auditlog/) | 18.0.2.0.6 | | Audit Log
+[auditlog](auditlog/) | 18.0.2.0.7 | | Audit Log
[auto_backup](auto_backup/) | 18.0.1.0.1 | | Backups database
[autovacuum_message_attachment](autovacuum_message_attachment/) | 18.0.1.0.1 |
| Automatically delete old mail messages and attachments
[base_cron_exclusion](base_cron_exclusion/) | 18.0.1.0.1 |
| Allow you to select scheduled actions that should not run simultaneously.
-[base_exception](base_exception/) | 18.0.1.1.0 |
| This module provide an abstract model to manage customizable exceptions to be applied on different models (sale order, invoice, ...)
+[base_exception](base_exception/) | 18.0.1.1.1 |
| This module provide an abstract model to manage customizable exceptions to be applied on different models (sale order, invoice, ...)
[base_fontawesome](base_fontawesome/) | 18.0.2.0.0 | | Up to date Fontawesome resources.
[base_fontawesome_web_editor](base_fontawesome_web_editor/) | 18.0.1.0.0 | | Integration between base_fontawesome and web_editor for FontAwesome >= 6.7.2 support.
[base_force_record_noupdate](base_force_record_noupdate/) | 18.0.1.0.0 | | Manually force noupdate=True on models
[base_m2m_custom_field](base_m2m_custom_field/) | 18.0.1.0.0 | | Customizations of Many2many
[base_model_restrict_update](base_model_restrict_update/) | 18.0.1.0.0 |
| Update Restrict Model
-[base_name_search_improved](base_name_search_improved/) | 18.0.1.1.0 | | Friendlier search when typing in relation fields
-[base_partition](base_partition/) | 18.0.1.0.0 | | Base module that provide the partition method on all models
+[base_name_search_improved](base_name_search_improved/) | 18.0.1.1.1 | | Friendlier search when typing in relation fields
+[base_partition](base_partition/) | 18.0.1.0.1 | | Base module that provide the partition method on all models
[base_remote](base_remote/) | 18.0.1.0.0 | | Remote Base
[base_search_fuzzy](base_search_fuzzy/) | 18.0.1.0.0 | | Fuzzy search with the PostgreSQL trigram extension
-[base_sequence_option](base_sequence_option/) | 18.0.1.0.0 |
| Alternative sequence options for specific models
+[base_sequence_option](base_sequence_option/) | 18.0.1.0.1 |
| Alternative sequence options for specific models
[base_sparse_field_list_support](base_sparse_field_list_support/) | 18.0.1.0.0 | | add list support to convert_to_cache()
[base_technical_user](base_technical_user/) | 18.0.1.0.1 | | Add a technical user parameter on the company
[base_temporary_action](base_temporary_action/) | 18.0.1.0.0 | | This addon allows to create temporary actions
-[base_time_window](base_time_window/) | 18.0.1.1.0 | | Base model to handle time windows
+[base_time_window](base_time_window/) | 18.0.1.1.1 | | Base model to handle time windows
[base_view_inheritance_extension](base_view_inheritance_extension/) | 18.0.1.0.2 | | Adds more operators for view inheritance
[bus_alt_connection](bus_alt_connection/) | 18.0.1.0.0 | | Needed when using PgBouncer as a connection pooler
[database_cleanup](database_cleanup/) | 18.0.1.0.2 | | Database cleanup
@@ -54,14 +54,14 @@ addon | version | maintainers | summary
[fetchmail_notify_error_to_sender](fetchmail_notify_error_to_sender/) | 18.0.1.0.0 | | If fetching mails gives error, send an email to sender
[html_text](html_text/) | 18.0.1.0.0 | | Generate excerpts from any HTML field
[iap_alternative_provider](iap_alternative_provider/) | 18.0.1.0.0 |
| Base module for providing alternative provider for iap apps
-[jsonifier](jsonifier/) | 18.0.1.1.0 | | JSON-ify data for all models
+[jsonifier](jsonifier/) | 18.0.1.1.1 | | JSON-ify data for all models
[mail_cleanup](mail_cleanup/) | 18.0.1.0.1 | | Mark as read or delete mails after a set time
[module_analysis](module_analysis/) | 18.0.1.0.0 |
| Add analysis tools regarding installed modules to know which installed modules comes from Odoo Core, OCA, or are custom modules
-[module_auto_update](module_auto_update/) | 18.0.1.0.0 | | Automatically update Odoo modules
+[module_auto_update](module_auto_update/) | 18.0.1.0.1 | | Automatically update Odoo modules
[module_change_auto_install](module_change_auto_install/) | 18.0.1.0.3 |
| Customize auto installables modules by configuration
[odoo_test_xmlrunner](odoo_test_xmlrunner/) | 18.0.1.0.0 | | This module override Odoo testing method to run them with xmlrunner tool.
[onchange_helper](onchange_helper/) | 18.0.1.0.1 | | Technical module that ease execution of onchange in Python code
-[rpc_helper](rpc_helper/) | 18.0.1.0.1 |
| Helpers for disabling RPC calls
+[rpc_helper](rpc_helper/) | 18.0.1.0.2 |
| Helpers for disabling RPC calls
[scheduler_error_mailer](scheduler_error_mailer/) | 18.0.1.0.0 | | Scheduler Error Mailer
[sentry](sentry/) | 18.0.1.0.4 |
| Report Odoo errors to Sentry
[sequence_python](sequence_python/) | 18.0.1.0.0 | | Calculate a sequence number from a Python expression
@@ -70,7 +70,7 @@ addon | version | maintainers | summary
[test_base_time_window](test_base_time_window/) | 18.0.1.0.0 | | Test Base model to handle time windows
[tracking_manager](tracking_manager/) | 18.0.1.1.0 |
| This module tracks all fields of a model, including one2many and many2many ones.
[tracking_manager_domain](tracking_manager_domain/) | 18.0.1.0.1 |
| This module extends the tracking manager to allow to define a domain on fields to track changes only when certain conditions apply.
-[upgrade_analysis](upgrade_analysis/) | 18.0.1.4.3 |
| Performs a difference analysis between modules installed on two different Odoo instances
+[upgrade_analysis](upgrade_analysis/) | 18.0.1.4.4 |
| Performs a difference analysis between modules installed on two different Odoo instances
[//]: # (end addons)
diff --git a/attachment_queue/README.rst b/attachment_queue/README.rst
index 2a2add50364..1ba66a5d60c 100644
--- a/attachment_queue/README.rst
+++ b/attachment_queue/README.rst
@@ -11,7 +11,7 @@ Attachment Queue
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:bea3c21621c6f5d818a3554b23126cc117a204fcd978b5909069090a09c5d6d4
+ !! source digest: sha256:fafc8b3a64f141a0b20e65bb4f01c86fc26516c598bff7bfe20b3bf5c97ed8da
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/attachment_queue/__manifest__.py b/attachment_queue/__manifest__.py
index b9960e1116b..dc0e6feb260 100644
--- a/attachment_queue/__manifest__.py
+++ b/attachment_queue/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "Attachment Queue",
- "version": "18.0.1.0.0",
+ "version": "18.0.1.0.1",
"author": "Akretion,Odoo Community Association (OCA)",
"summary": "Base module adding the concept of queue for processing files",
"website": "https://github.com/OCA/server-tools",
diff --git a/attachment_queue/static/description/index.html b/attachment_queue/static/description/index.html
index 44313a3ad78..d4154a6aeb1 100644
--- a/attachment_queue/static/description/index.html
+++ b/attachment_queue/static/description/index.html
@@ -372,7 +372,7 @@
This module adds async processing capabilities to attachments by diff --git a/attachment_queue/tests/test_attachment_queue.py b/attachment_queue/tests/test_attachment_queue.py index 38951c53f5a..acad15a62b4 100644 --- a/attachment_queue/tests/test_attachment_queue.py +++ b/attachment_queue/tests/test_attachment_queue.py @@ -32,25 +32,20 @@ def _create_dummy_attachment(self, override=False, no_job=False): ).create(vals) return self.env["attachment.queue"].create(vals) - @classmethod - def setUpClass(cls): - super().setUpClass() - cls.loader = FakeModelLoader(cls.env, cls.__module__) - cls.loader.backup_registry() - from .test_models import AttachmentQueue - - cls.loader.update_registry((AttachmentQueue,)) - - @classmethod - def tearDownClass(cls): - super().tearDownClass() - cls.loader.restore_registry() - return super().tearDownClass() - def setUp(self): super().setUp() + self.loader = FakeModelLoader(self.env, self.__module__) + self.loader.backup_registry() + from .test_models import AttachmentQueue + + self.loader.update_registry((AttachmentQueue,)) self.aq_model = self.env["attachment.queue"] + def tearDown(self): + super().tearDown() + self.loader.restore_registry() + return super().tearDown() + def test_job_created(self): with trap_jobs() as trap: attachment = self._create_dummy_attachment() diff --git a/auditlog/README.rst b/auditlog/README.rst index 42312cf1196..dc4721d5c40 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:eff893d734bc46c69f3872737aa234d2a2aaf763da5259ac3e977f22d1e4f3a9 + !! source digest: sha256:e0e544c7a26986bb9117c221de2a8725c1ac094fd65ad0b4719fc51df383d7e2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/auditlog/__manifest__.py b/auditlog/__manifest__.py index 629376ca5bf..a36026b4067 100644 --- a/auditlog/__manifest__.py +++ b/auditlog/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Audit Log", - "version": "18.0.2.0.6", + "version": "18.0.2.0.7", "author": "ABF OSIELL, Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/server-tools", diff --git a/auditlog/models/rule.py b/auditlog/models/rule.py index 32ff17c746c..7e914e7a7d5 100644 --- a/auditlog/models/rule.py +++ b/auditlog/models/rule.py @@ -216,7 +216,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": @@ -273,15 +273,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 141e62d3af5..b85c2a81937 100644 --- a/auditlog/static/description/index.html +++ b/auditlog/static/description/index.html @@ -372,7 +372,7 @@
This module allows the administrator to log user operations performed on
diff --git a/auditlog/tests/common.py b/auditlog/tests/common.py
index e1004cd408d..25cab8e1ad7 100644
--- a/auditlog/tests/common.py
+++ b/auditlog/tests/common.py
@@ -1,33 +1,27 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-from odoo.tests.common import TransactionCase
+from odoo.tests.common import SETATTR_SOURCES
+from odoo.addons.base.tests.common import BaseCommon
+
+# Register rule.py as a known path in odoo.tests.common for patching methods
+SETATTR_SOURCES["_patch_method"] = tuple(
+ list(SETATTR_SOURCES.get("_patch_method", [])) + ["/auditlog/models/rule.py"],
+)
-class AuditLogRuleCommon(TransactionCase):
- @classmethod
- def setUpClass(cls):
- super().setUpClass()
- cls.models = set()
+class AuditLogRuleCommon(BaseCommon):
@classmethod
def create_rule(cls, vals):
- rule = cls.env["auditlog.rule"].with_context(tracking_disable=True).create(vals)
- # Keep track of patched models
- cls.models |= set(rule.model_id.mapped("model"))
- return rule
+ # Deprecated, just call `create` in your test setup.
+ return cls.env["auditlog.rule"].create(vals)
- @classmethod
- def tearDownClass(cls):
- for rule in cls.env["auditlog.rule"].search([]):
+ def tearDown(self):
+ # Unsubscribe all rules in tearDown to prevent Odoo's patch checker in
+ # tests/common.py from ringing the alarm.
+ for rule in self.env["auditlog.rule"].search([]):
try:
rule.unsubscribe()
except KeyError: # pragma: no cover
- continue # Model not loaded yet
-
- # Assert no patched methods remain
- for model in cls.models:
- for method in ["create", "read", "write", "unlink"]:
- assert not hasattr(
- getattr(cls.env[model], method), "origin"
- ), f"{model} {method} still patched"
- super().tearDownClass()
+ continue # Preexisting rule for model not loaded yet
+ return super().tearDown()
diff --git a/auditlog/tests/test_auditlog.py b/auditlog/tests/test_auditlog.py
index e4c3aeaa18b..67fea7b07e8 100644
--- a/auditlog/tests/test_auditlog.py
+++ b/auditlog/tests/test_auditlog.py
@@ -3,6 +3,8 @@
# © 2021 Stefan Rijnhart This module provide an abstract model to manage customizable exceptions
to be applied on different models (sale order, invoice, …). It is not useful by itself. You can see an example of implementation in
@@ -390,13 +395,13 @@ This module executes user-provided code though a safe_eval which might
be unsecure. How to mitigate risks should be adressed in future versions
of this module. Bugs are tracked on GitHub 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
@@ -404,9 +409,9 @@ Do not contact contributors directly about support or help with technical issues. The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.Exception Rule
+
+
+
Exception Rule
-
+
Exception Rule
Known issues / Roadmap
+Known issues / Roadmap
Bug Tracker
+Bug Tracker
Bug Tracker
Credits
+Credits
Contributors
+Contributors
Contributors
Other credits
+Other credits