Skip to content

Commit 596b3b1

Browse files
rco-odooaj-fuentes
authored andcommitted
[REF] core: move building model methods to a separate file
Simply adapt registry.setup_models() to its new name for saas-18.2. odoo/odoo#193559 odoo/enterprise#77278 closes #207 Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
1 parent 9757242 commit 596b3b1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/util/orm.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ def _add_magic_fields(self):
719719

720720
with all_patches():
721721
# 4. Reload the registry with the models and fields converted to manual.
722-
env.registry.setup_models(env.cr)
722+
setup_models = (
723+
env.registry._setup_models__ if hasattr(env.registry, "_setup_models__") else env.registry.setup_models
724+
)
725+
setup_models(env.cr)
723726

724727
# 5. Do the operation.
725728
yield
@@ -759,4 +762,7 @@ def _add_magic_fields(self):
759762

760763
# 7. Reload the registry as before
761764
env.clear()
762-
env.registry.setup_models(env.cr)
765+
setup_models = (
766+
env.registry._setup_models__ if hasattr(env.registry, "_setup_models__") else env.registry.setup_models
767+
)
768+
setup_models(env.cr)

0 commit comments

Comments
 (0)