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
1=== modified file 'openerp/tools/convert.py'
2--- openerp/tools/convert.py 2014-01-16 09:17:16 +0000
3+++ openerp/tools/convert.py 2014-02-18 20:49:22 +0000
4@@ -133,8 +133,8 @@
5 ids = pool[f_model].search(cr, uid, q)
6 if f_use != 'id':
7 ids = map(lambda x: x[f_use], pool[f_model].read(cr, uid, ids, [f_use]))
8- _cols = pool[f_model]._columns
9- if (f_name in _cols) and _cols[f_name]._type=='many2many':
10+ _cols = pool[f_model]._all_columns
11+ if (f_name in _cols) and _cols[f_name].column._type=='many2many':
12 return ids
13 f_val = False
14 if len(ids):
15@@ -821,9 +821,9 @@
16 # browse the objects searched
17 s = f_obj.browse(cr, self.uid, f_obj.search(cr, self.uid, q))
18 # column definitions of the "local" object
19- _cols = self.pool[rec_model]._columns
20+ _cols = self.pool[rec_model]._all_columns
21 # if the current field is many2many
22- if (f_name in _cols) and _cols[f_name]._type=='many2many':
23+ if (f_name in _cols) and _cols[f_name].column._type=='many2many':
24 f_val = [(6, 0, map(lambda x: x[f_use], s))]
25 elif len(s):
26 # otherwise (we are probably in a many2one field),