Merge lp:~julie-w/unifield-server/US-2495 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merge reported by: jftempo
Merged at revision: not available
Proposed branch: lp:~julie-w/unifield-server/US-2495
Merge into: lp:unifield-server
Diff against target: 74 lines (+8/-10)
2 files modified
bin/addons/account/report/account_general_ledger.py (+5/-3)
bin/addons/finance/account_drill.py (+3/-7)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-2495
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+326754@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/account/report/account_general_ledger.py'
2--- bin/addons/account/report/account_general_ledger.py 2016-07-20 13:04:41 +0000
3+++ bin/addons/account/report/account_general_ledger.py 2017-07-04 09:20:48 +0000
4@@ -185,11 +185,13 @@
5 query = self.query
6 if self.reconciled_filter:
7 query += self.reconciled_filter
8+ if self.target_move == 'posted':
9+ query += " AND am.state = 'posted' "
10+ else:
11+ query += " AND am.state in ('draft', 'posted') "
12
13- move_states = [ 'posted', ] if self.target_move == 'posted' \
14- else [ 'draft', 'posted', ]
15 self._drill = self.pool.get("account.drill").build_tree(self.cr,
16- self.uid, query, self.init_query, move_states=move_states,
17+ self.uid, query, self.init_query,
18 include_accounts=self.account_ids,
19 account_report_types=self.account_report_types,
20 with_balance_only=self.display_account == 'bal_solde',
21
22=== modified file 'bin/addons/finance/account_drill.py'
23--- bin/addons/finance/account_drill.py 2016-06-02 14:10:07 +0000
24+++ bin/addons/finance/account_drill.py 2017-07-04 09:20:48 +0000
25@@ -95,7 +95,7 @@
26 WHERE l.account_id = %s and per.number = 0{query}
27 GROUP BY l.currency_id'''
28
29- def __init__(self, pool, cr, uid, query, query_ib, move_states=None,
30+ def __init__(self, pool, cr, uid, query, query_ib,
31 include_accounts=False, account_report_types=False,
32 with_balance_only=False, reconcile_filter='', context=None):
33 super(AccountDrill, self).__init__()
34@@ -105,14 +105,11 @@
35 self.context = context
36 if self.context is None:
37 self.context = {}
38- if move_states is None:
39- move_states = []
40 self.model = self.pool.get('account.account')
41
42 # passed params
43 self.query = query or ''
44 self.query_ib = query_ib or ''
45- self.move_states = move_states or [ 'draft', 'posted', ]
46 self.include_accounts = include_accounts
47 self.account_report_types = account_report_types
48 self.with_balance_only = with_balance_only
49@@ -294,7 +291,7 @@
50
51 # regular query
52 sql = prepare_sql(self.sql, self.query, node)
53- self.cr.execute(sql, (account_id, tuple(self.move_states), ))
54+ self.cr.execute(sql)
55 register_sql_result(self.cr, node)
56
57 # initial balance
58@@ -334,7 +331,7 @@
59 _name = "account.drill"
60 _auto = False
61
62- def build_tree(self, cr, uid, query, query_ib, move_states=[],
63+ def build_tree(self, cr, uid, query, query_ib,
64 include_accounts=False, account_report_types=False,
65 with_balance_only=False, reconcile_filter='',
66 context=None):
67@@ -353,7 +350,6 @@
68 accounts with a balance to zero)
69 """
70 ac = AccountDrill(self.pool, cr, uid, query, query_ib,
71- move_states=move_states,
72 include_accounts=include_accounts,
73 account_report_types=account_report_types,
74 with_balance_only=with_balance_only,

Subscribers

People subscribed via source and target branches