From bfcda158fefbc838c9fe0196ad2b53a8e210b57e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 10 Apr 2020 10:42:46 +0000 Subject: [PATCH] [FIX] core: logging of arguments remoteobjects odoo/odoo#46024 improved the serialisation of arrays being logged (in order to get more relevant data than just `Array(5)`. However, chrome apparently serialises *argument* objects as array-like with a few nits, namely that arguments have non-numeric properties which don't necessarily have a value associated with them. The array formatter / converter assumed all properties had a value, resulting in the process crashing rather dramatically. Filter out non-numeric properties on arrays. closes odoo/odoo#49418 X-original-commit: 5ff1e41c98f042fd13a1762977cc76604231dfd4 Signed-off-by: Xavier Morel (xmo) --- odoo/tests/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odoo/tests/common.py b/odoo/tests/common.py index 7dc9ba076f2..0d984051fef 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -1117,10 +1117,12 @@ class ChromeBrowser(): return '[%s]' % ', '.join( repr(p['value']) if p['type'] == 'string' else str(p['value']) for p in arg.get('preview', {}).get('properties', []) + if re.match(r'\d+', p['name']) ) # all that's left is type=object, subtype=None aka custom or # non-standard objects, print as TypeName(param=val, ...), sadly because # of the way Odoo widgets are created they all appear as Class(...) + # nb: preview properties are *not* recursive, the value is *all* we get return '%s(%s)' % ( arg.get('className') or 'object', ', '.join(