Reviewers: ,


Please review this at http://codereview.tryton.org/312003/

Affected files:
  M trytond/ir/rule.py
  M trytond/tools/misc.py


Index: trytond/ir/rule.py
===================================================================
--- a/trytond/ir/rule.py
+++ b/trytond/ir/rule.py
@@ -121,8 +121,9 @@
         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']] = \
Index: trytond/tools/misc.py
===================================================================
--- a/trytond/tools/misc.py
+++ b/trytond/tools/misc.py
@@ -368,7 +368,7 @@
     '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)


--
[email protected] mailing list

Reply via email to