Merge lp:~therp-nl/ocb-addons/6.1_lp1237832 into lp:ocb-addons/6.1

Proposed by Holger Brunn (Therp)
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: no longer in the source branch.
Merged at revision: 6835
Proposed branch: lp:~therp-nl/ocb-addons/6.1_lp1237832
Merge into: lp:ocb-addons/6.1
Diff against target: 26 lines (+15/-1)
1 file modified
account_budget/account_budget.py (+15/-1)
To merge this branch: bzr merge lp:~therp-nl/ocb-addons/6.1_lp1237832
Reviewer Review Type Date Requested Status
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Approve
Stefan Rijnhart (Opener) test Approve
Christophe CHAUVET code review, no test Approve
Review via email: mp+190312@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi

Thanks for the MP

It's OK for me

Regards,

review: Approve (code review, no test)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) :
review: Approve (test)
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_budget/account_budget.py'
2--- account_budget/account_budget.py 2013-10-09 12:24:36 +0000
3+++ account_budget/account_budget.py 2013-10-10 08:53:35 +0000
4@@ -126,7 +126,21 @@
5 if context.has_key('wizard_date_to'):
6 date_to = context['wizard_date_to']
7 if line.analytic_account_id.id:
8- cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id=%s AND (date "
9+ cr.execute("SELECT SUM(amount) FROM account_analytic_line WHERE account_id in "
10+ """(with recursive account_analytic_account_hierarchy(id)
11+ as
12+ (
13+ select id from account_analytic_account
14+ where id=%s
15+ union all
16+ select account_analytic_account.id from
17+ account_analytic_account
18+ join account_analytic_account_hierarchy
19+ on account_analytic_account.parent_id=
20+ account_analytic_account_hierarchy.id
21+ )"""
22+ "select id from account_analytic_account_hierarchy) "
23+ "AND (date "
24 "between to_date(%s,'yyyy-mm-dd') AND to_date(%s,'yyyy-mm-dd')) AND "
25 "general_account_id=ANY(%s)", (line.analytic_account_id.id, date_from, date_to,acc_ids,))
26 result = cr.fetchone()[0]

Subscribers

People subscribed via source and target branches