Merge lp:~camptocamp/c2c-financial-addons/6.1-fix-counterpart-1016390 into lp:c2c-financial-addons/6.1

Proposed by Guewen Baconnier @ Camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/c2c-financial-addons/6.1-fix-counterpart-1016390
Merge into: lp:c2c-financial-addons/6.1
Diff against target: 24 lines (+5/-8)
1 file modified
account_financial_report_webkit/report/common_reports.py (+5/-8)
To merge this branch: bzr merge lp:~camptocamp/c2c-financial-addons/6.1-fix-counterpart-1016390
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+131135@code.launchpad.net

Description of the change

related to lp:1016390

I'm not sure that is a correction for the bug, but this query needed to be simplified anyway.

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM

review: Approve (code review, no tests)

Unmerged revisions

92. By Guewen Baconnier @ Camptocamp <email address hidden> on 2012-10-24

[FIX] account_financial_report_webkit: fix the query which build a list of accounts counterparts

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_financial_report_webkit/report/common_reports.py'
2--- account_financial_report_webkit/report/common_reports.py 2012-02-23 14:14:02 +0000
3+++ account_financial_report_webkit/report/common_reports.py 2012-10-24 08:01:19 +0000
4@@ -481,15 +481,12 @@
5 SELECT account_move.id,
6 array_to_string(
7 ARRAY(SELECT DISTINCT a.code
8- FROM account_move_line m2
9- LEFT JOIN account_account a ON (m2.account_id=a.id)
10- WHERE m2.move_id =account_move_line.move_id
11- AND m2.account_id<>%s limit %s) , ', ')
12-
13+ FROM account_move_line ml
14+ JOIN account_account a ON (ml.account_id = a.id)
15+ WHERE ml.move_id = account_move.id
16+ AND ml.account_id != %s limit %s), ', ')
17 FROM account_move
18- JOIN account_move_line on (account_move_line.move_id = account_move.id)
19- JOIN account_account on (account_move_line.account_id = account_account.id)
20-WHERE move_id in %s"""
21+WHERE id in %s"""
22
23 try:
24 self.cursor.execute(sql, (account_id, limit, tuple(move_ids)))

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: