Skip to content

Commit

Permalink
[FIX] restore_registry in Odoo 16
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanRijnhart committed Dec 2, 2022
1 parent 4e11ce8 commit 737d8f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion odoo_test_helper/fake_model_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ def restore_registry(self):
for key in self._original_registry:
ori = self._original_registry[key]
model = self.env.registry[key]
model.__bases__ = ori["base"]
if hasattr(model, "_BaseModel__base_classes"):
model._BaseModel__base_classes = ori["base"]
else:
# Before V16
model._bases__ = ori["base"]
model._inherit_children = ori["_inherit_children"]
model._inherits_children = ori["_inherits_children"]
for field in model._fields:
Expand Down

0 comments on commit 737d8f5

Please sign in to comment.