summaryrefslogtreecommitdiff
path: root/odoo/tools
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-07-15 07:25:06 +0000
committerXavier Morel <xmo@odoo.com>2020-07-16 12:04:57 +0000
commitc0745584aa6a3da870a831fb766900a74718c5e4 (patch)
tree49cb06e11b424b2b1ed299f8ade3a4d8779e718a /odoo/tools
parentfde2b7a9780e82c565092d13ac4b89272f40f552 (diff)
[FIX] core: handle recordsets in traverse_containers
Since recordsets are self-recursive, they should be treated like strings (where iterating a string yields a string, infinitely) in case somebody happens to return a non-downgraded recordset from a method. closes odoo/odoo#54572 X-original-commit: 6d88845f339d164fc2667c3417dcc331b317e4db Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'odoo/tools')
-rw-r--r--odoo/tools/misc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py
index e1dc069cddb..31e391fe30e 100644
--- a/odoo/tools/misc.py
+++ b/odoo/tools/misc.py
@@ -1563,9 +1563,10 @@ def traverse_containers(val, type_):
through standard containers (non-string mappings or sequences) *unless*
they're selected by the type filter
"""
+ from odoo.models import BaseModel
if isinstance(val, type_):
yield val
- elif isinstance(val, (str, bytes)):
+ elif isinstance(val, (str, bytes, BaseModel)):
return
elif isinstance(val, Mapping):
for k, v in val.items():