Skip to content

Commit 2a94ce4

Browse files
committed
[FIX] server: Return Relational symbol when comodel is not present in context
If 'comodel_name' is not present in context when evaluating a Realtional field (Many2one, etc..), it should return the symbol of the field itself, for the case where the user do a request on a non-instancied expression. Ex: on "fields.Many2one"
1 parent 23010d6 commit 2a94ce4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/core/python_arch_eval_odoo_hooks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def _get_symbol_hook(self, rr_symbol, context):
5252
class EvaluationRelational(Evaluation):
5353

5454
def _get_symbol_hook(self, rr_symbol, context):
55+
if "comodel_name" not in context:
56+
return rr_symbol
5557
model = Odoo.get().models.get(context["comodel_name"], None)
5658
if model:
5759
main_sym = model.get_main_symbols() #module) #TODO use module in context

0 commit comments

Comments
 (0)