Merge lp:~initos.com/openobject-server/trunk-bug-1281769 into lp:openobject-server

Proposed by Thomas Rehn
Status: Needs review
Proposed branch: lp:~initos.com/openobject-server/trunk-bug-1281769
Merge into: lp:openobject-server
Diff against target: 26 lines (+4/-4)
1 file modified
openerp/tools/convert.py (+4/-4)
To merge this branch: bzr merge lp:~initos.com/openobject-server/trunk-bug-1281769
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+207030@code.launchpad.net

Description of the change

Fixes a column inheritance bug in XML search evaluation.

To post a comment you must log in.

Unmerged revisions

5087. By Thomas Rehn

another column inheritance bug

5086. By Thomas Rehn

fixes #1281769, use _all_columns instead of _columns

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openerp/tools/convert.py'
--- openerp/tools/convert.py 2014-01-16 09:17:16 +0000
+++ openerp/tools/convert.py 2014-02-18 20:49:22 +0000
@@ -133,8 +133,8 @@
133 ids = pool[f_model].search(cr, uid, q)133 ids = pool[f_model].search(cr, uid, q)
134 if f_use != 'id':134 if f_use != 'id':
135 ids = map(lambda x: x[f_use], pool[f_model].read(cr, uid, ids, [f_use]))135 ids = map(lambda x: x[f_use], pool[f_model].read(cr, uid, ids, [f_use]))
136 _cols = pool[f_model]._columns136 _cols = pool[f_model]._all_columns
137 if (f_name in _cols) and _cols[f_name]._type=='many2many':137 if (f_name in _cols) and _cols[f_name].column._type=='many2many':
138 return ids138 return ids
139 f_val = False139 f_val = False
140 if len(ids):140 if len(ids):
@@ -821,9 +821,9 @@
821 # browse the objects searched821 # browse the objects searched
822 s = f_obj.browse(cr, self.uid, f_obj.search(cr, self.uid, q))822 s = f_obj.browse(cr, self.uid, f_obj.search(cr, self.uid, q))
823 # column definitions of the "local" object823 # column definitions of the "local" object
824 _cols = self.pool[rec_model]._columns824 _cols = self.pool[rec_model]._all_columns
825 # if the current field is many2many825 # if the current field is many2many
826 if (f_name in _cols) and _cols[f_name]._type=='many2many':826 if (f_name in _cols) and _cols[f_name].column._type=='many2many':
827 f_val = [(6, 0, map(lambda x: x[f_use], s))]827 f_val = [(6, 0, map(lambda x: x[f_use], s))]
828 elif len(s):828 elif len(s):
829 # otherwise (we are probably in a many2one field),829 # otherwise (we are probably in a many2one field),