Chris Biersbach (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-server/6.0-opw-577609-cbi into 
lp:openobject-server/6.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-577609-cbi/+merge/127743

when the id field is redefined in an inheriting class, the test "if not field" 
is not true.

in this case, "id child_of ..." in expressions will not be correctly parsed, 
this will result in a traceback.

to reproduce, create a minimal addon with a class inheriting from 
account.account, redefining the id field.
when trying to delete an account, a traceback appears, because the check_moves 
test contains an "id child_of ..." expression.

this issue is fixed in this branch, by testing for the additional case of an id 
field of type integer
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-opw-577609-cbi/+merge/127743
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/6.0-opw-577609-cbi.
=== modified file 'bin/osv/expression.py'
--- bin/osv/expression.py	2011-01-17 08:41:08 +0000
+++ bin/osv/expression.py	2012-10-03 12:37:23 +0000
@@ -178,6 +178,11 @@
                             self.__exp.insert(i + 2 + j, se)
             # else, the value of the field is store in the database, so we search on it
 
+            elif field._type == 'integer':
+                if left == 'id' and operator == 'child_of':
+                    dom = _rec_get(right, working_table)
+                    self.__exp = self.__exp[:i] + dom + self.__exp[i+1:]
+
             elif field._type == 'one2many':
                 # Applying recursivity on field(one2many)
                 if operator == 'child_of':

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to