Skip to content

Commit 967b66b

Browse files
committed
[FIX] server: avoid crash on model not in a module
If a model is not declared in a valid odoo module, the code is actually crashing. This commit prevent it and return the symbol even if the dependencies are not valid, as it can't be evaluated. This is not a really nice case, but having a model declaration outside of a module is not really somthing that should happen
1 parent 643d4db commit 967b66b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/core/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_main_symbols(self, from_module = None, module_acc:set = None):
1919
res = []
2020
for sym in self.impl_sym:
2121
if sym.modelData.name not in sym.modelData.inherit:
22-
if not from_module or \
22+
if not from_module or not sym.get_module_symbol() or \
2323
(module_acc and sym.get_module_sym().dir_name in module_acc) or \
2424
from_module.is_in_deps(sym.get_module_sym().dir_name, module_acc):
2525
res.append(sym)

0 commit comments

Comments
 (0)