Merge lp:~credativ/openobject-addons/fix-c2c-budgets into lp:openobject-addons/extra-trunk

Proposed by Dimitri John Ledkov (ex-credativ)
Status: Needs review
Proposed branch: lp:~credativ/openobject-addons/fix-c2c-budgets
Merge into: lp:openobject-addons/extra-trunk
Diff against target: 40 lines (+5/-11)
1 file modified
c2c_budget/wizard/validate_budget_structure.py (+5/-11)
To merge this branch: bzr merge lp:~credativ/openobject-addons/fix-c2c-budgets
Reviewer Review Type Date Requested Status
Camptocamp Pending
OpenERP Committers Pending
Review via email: mp+81576@code.launchpad.net

Description of the change

Forward-port of a fix from 5.0 which didn't get applied to 6.0 nor trunk.

To post a comment you must log in.
Revision history for this message
Numérigraphe (numerigraphe) wrote :

Asked for review from c2c since they are probably the authors of the module.
Lionel.

Unmerged revisions

5490. By gpa(OpenERP) on 2010-02-01

[FIX] c2c_budget module: Corrected account_account_rel missing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'c2c_budget/wizard/validate_budget_structure.py'
2--- c2c_budget/wizard/validate_budget_structure.py 2009-10-15 11:25:40 +0000
3+++ c2c_budget/wizard/validate_budget_structure.py 2011-11-08 13:53:04 +0000
4@@ -81,7 +81,7 @@
5 self.cr = cr
6
7 sql_filters = self._get_sql_filters(data['form']['company'], data['form']['account_type'][0][2])
8- sql_filters_aa2 = self._get_sql_filters(data['form']['company'], data['form']['account_type'][0][2], 'aa2')
9+ sql_filters_aa2 = self._get_sql_filters(data['form']['company'], data['form']['account_type'][0][2], 'aa')
10
11 root_id = data['ids'][0]
12
13@@ -213,10 +213,8 @@
14 """ return all account that do not have parents """
15
16 query = """ SELECT distinct(aa.id)
17- FROM account_account aa LEFT OUTER JOIN account_account_rel rel ON (aa.id = rel.child_id)
18- WHERE rel.child_id IS NULL
19- AND aa.active
20- %s """ % sql_filters
21+ FROM account_account aa
22+ WHERE aa.active %s """ % sql_filters
23 self.cr.execute(query)
24
25 result = map(lambda x: x[0], self.cr.fetchall())
26@@ -234,12 +232,8 @@
27
28 #build a dictionnary {parent_id -> [children_ids]}
29 children_ids = {}
30- query = """SELECT rel.child_id, rel.parent_id
31- FROM account_account_rel rel, account_account aa, account_account aa2
32- WHERE rel.parent_id = aa.id
33- AND rel.child_id = aa2.id
34- AND aa.active
35- AND aa2.active %s """ % (sql_filter)
36+ query = """SELECT aa.id, aa.parent_id
37+ FROM account_account aa WHERE aa.active %s """ % (sql_filter)
38
39 self.cr.execute(query)
40 for i in self.cr.fetchall():

Subscribers

People subscribed via source and target branches