Merge lp:~openerp-dev/openobject-addons/6.1-opw-582487-cbi into lp:openobject-addons/6.1

Proposed by Chris Biersbach (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-582487-cbi
Merge into: lp:openobject-addons/6.1
Diff against target: 19 lines (+3/-3)
1 file modified
account/account_move_line.py (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-582487-cbi
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+137799@code.launchpad.net

Description of the change

The issue that was encountered: When adding an advanced filter on the search view of Journal Items, "is set" and "is not set" did not work correctly for the invoice field

The reason: An SQL query was incorrect

The fix: I changed the query to do a left join, fixing the problem

To post a comment you must log in.

Unmerged revisions

7086. By Chris Biersbach (OpenERP)

[FIX] This fixes an fnct_search on account_move_line to correctly work with 'is set' and'is not set'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2012-09-06 14:35:17 +0000
3+++ account/account_move_line.py 2012-12-04 10:46:09 +0000
4@@ -449,12 +449,12 @@
5 else:
6 qu1.append(' (False)')
7 if qu1:
8- qu1 = ' AND' + ' AND'.join(qu1)
9+ qu1 = ' AND'.join(qu1)
10 else:
11 qu1 = ''
12 cursor.execute('SELECT l.id ' \
13- 'FROM account_move_line l, account_invoice i ' \
14- 'WHERE l.move_id = i.move_id ' + qu1, qu2)
15+ 'FROM account_move_line l LEFT JOIN account_invoice i ON (i.move_id = l.move_id) WHERE ' + qu1, qu2)
16+ print cursor.query
17 res = cursor.fetchall()
18 if not res:
19 return [('id', '=', '0')]