Skip to content

Commit 425afda

Browse files
committed
Merge PR #535 into 18.0
Signed-off-by lmignon
2 parents b93b8f2 + 1188964 commit 425afda

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"pull_requests": {
3+
"orphaned_commits": "(auto) Nothing to port from PR #",
4+
"OCA/rest-framework#313": "Already ported",
5+
"OCA/rest-framework#348": "(auto) Nothing to port from PR #348"
6+
}
7+
}

extendable/tests/common.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from odoo.modules.registry import Registry
99
from odoo.tests import common
1010

11-
from extendable import context
11+
from extendable import context, main
1212

1313

1414
def _get_addon_name(full_name: str) -> str:
@@ -54,6 +54,24 @@ def init_extendable_registry(cls):
5454
extendable_registry.init_registry([f"odoo.addons.{current_addon}.*"])
5555
cls.token = context.extendable_registry.set(cls._extendable_registry)
5656

57+
@classmethod
58+
def backup_extendable_registry(cls):
59+
# Store the current extendable classes
60+
cls._initial_extendable_class_defs_by_module = (
61+
main._extendable_class_defs_by_module
62+
)
63+
# Use a copy of the current extendable classes
64+
main._extendable_class_defs_by_module = dict(
65+
cls._initial_extendable_class_defs_by_module
66+
)
67+
68+
@classmethod
69+
def restore_extendable_registry(cls):
70+
# Restore the initial extendable classes
71+
main._extendable_class_defs_by_module = (
72+
cls._initial_extendable_class_defs_by_module
73+
)
74+
5775
@classmethod
5876
def reset_extendable_registry(cls):
5977
context.extendable_registry.reset(cls.token)

0 commit comments

Comments
 (0)