Prevent rule to fail when evaluating values
issue2519 review312003
This commit is contained in:
1 parent
184b4bcd91
commit
25839451d2
2 files changed
+4
-3
No files matched your search
+3
-2
@@ -121,8 +121,9 @@ class Rule(ModelSQL, ModelView):
|
||||
for k in key:
|
||||
|
||||
if obj_fields[k]['type'] in ('many2one'):
|
||||
res[root + '/' + obj_fields[k]['string']] = \
|
||||
root_tech + '.' + k + '.id'
|
||||
res[root + '/' + obj_fields[k]['string']] = (
|
||||
'(' + root_tech + '.' + k + '.id '
|
||||
'if ' + root_tech + ' else None)')
|
||||
|
||||
elif obj_fields[k]['type'] in ('many2many', 'one2many'):
|
||||
res[root + '/' + obj_fields[k]['string']] = \
|
||||
|
||||
@@ -368,7 +368,7 @@ _ALLOWED_CODES = set(dis.opmap[x] for x in [
|
||||
'STORE_NAME', 'GET_ITER', 'FOR_ITER', 'LIST_APPEND', 'JUMP_ABSOLUTE',
|
||||
'DELETE_NAME', 'JUMP_IF_TRUE', 'JUMP_IF_FALSE', 'JUMP_IF_FALSE_OR_POP',
|
||||
'JUMP_IF_TRUE_OR_POP', 'POP_JUMP_IF_FALSE', 'POP_JUMP_IF_TRUE',
|
||||
'BINARY_SUBSCR',
|
||||
'BINARY_SUBSCR', 'JUMP_FORWARD',
|
||||
] if x in dis.opmap)
|
||||
|
||||
@memoize(1000)
|
||||
|
||||
Reference in new issue
Block a user