Merge lp:~unifield-team/unifield-server/gl_report_parser_clean into lp:unifield-server

Proposed by Vincent GREINER
Status: Merged
Merged at revision: 3686
Proposed branch: lp:~unifield-team/unifield-server/gl_report_parser_clean
Merge into: lp:unifield-server
Diff against target: 134 lines (+0/-117)
1 file modified
bin/addons/account/report/account_general_ledger.py (+0/-117)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/gl_report_parser_clean
Reviewer Review Type Date Requested Status
jftempo Pending
Review via email: mp+290491@code.launchpad.net

Description of the change

unused code to remove for general ledger/trial balance report parser

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-03-23 14:52:23 +0000
3+++ bin/addons/account/report/account_general_ledger.py 2016-03-30 15:27:35 +0000
4@@ -190,7 +190,6 @@
5 'get_line_balance': self._get_line_balance,
6 'currency_conv': self._currency_conv,
7 'get_prop_instances': self._get_prop_instances,
8- 'get_currencies': self.get_currencies,
9 'get_display_info': self._get_display_info,
10 'get_show_move_lines': self.get_show_move_lines,
11 'get_ccy_label': self.get_ccy_label,
12@@ -240,122 +239,6 @@
13 return _('All Journals')
14 return ', '.join(self._get_journal(data))
15
16- def get_currencies(self, account=False, include_with_ib=False):
17- res = []
18-
19- sql = """
20- SELECT DISTINCT(l.currency_id)
21- FROM account_move_line AS l
22- WHERE %s
23- """ % (self.query)
24- if account:
25- sql += " and l.account_id=%d" % (account.id, )
26- self.cr.execute(sql)
27- rows = self.cr.fetchall() or []
28-
29- if include_with_ib and self.init_balance:
30- sql = """
31- SELECT DISTINCT(l.currency_id)
32- FROM account_move_line AS l
33- WHERE %s
34- """ % (self.init_query)
35- if account:
36- sql += " and l.account_id=%d" % (account.id, )
37- self.cr.execute(sql)
38- ib_rows = self.cr.fetchall() or []
39- if ib_rows:
40- rows += ib_rows
41- rows = list(set(rows))
42-
43- if rows:
44- rc_obj = self.pool.get('res.currency')
45- ordered_ids = rc_obj.search(self.cr, self.uid, [
46- ('id', 'in', [ r[0] for r in rows ]),
47- ], order='name')
48- res = rc_obj.browse(self.cr, self.uid, ordered_ids)
49-
50- return res
51-
52- def get_currencies_account_subtotals(self, account):
53- ccy_brs = self.get_currencies(account=account, include_with_ib=True)
54- res = []
55-
56- if ccy_brs:
57- for ccy in ccy_brs:
58- line = {
59- 'account_code': account and account.code or '',
60- 'ccy_name': ccy.name or ccy.code or '',
61- 'debit': self._sum_debit_account(account, ccy=ccy,
62- booking=True, is_sub_total=True),
63- 'credit': self._sum_credit_account(account, ccy=ccy,
64- booking=True, is_sub_total=True),
65- 'bal': self._sum_balance_account(account, ccy=ccy,
66- booking=True, is_sub_total=True),
67- }
68- # append the line if amount (and compute functional bal)
69- if line['debit'] or line['credit'] or line['bal']:
70- line['bal_func'] = self._sum_balance_account(account,
71- ccy=ccy, booking=False, is_sub_total=True),
72- res.append(line)
73- return res
74-
75- def get_children_accounts(self, account, ccy=False):
76- res = []
77- currency_obj = self.pool.get('res.currency')
78-
79- ids_acc = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account.id)
80- currency = account.currency_id and account.currency_id or account.company_id.currency_id
81- for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc, context=self.context):
82- if child_account.code.startswith('8') or child_account.code.startswith('9'):
83- # UF-1714: exclude accounts '8*'/'9*'
84- continue
85- if self.account_report_types:
86- # filter by B/S P&L report type
87- if child_account.user_type \
88- and child_account.user_type.report_type:
89- do_filtering = True
90- if 'asset' in self.account_report_types \
91- or 'liability' in self.account_report_types:
92- if child_account.user_type \
93- and child_account.user_type.code == 'tax':
94- # since US-227/7.1 we display tax account when
95- # BS acccounts are asked
96- do_filtering = False
97- if do_filtering and child_account.user_type.report_type \
98- not in self.account_report_types:
99- continue
100- if self.unreconciled_filter:
101- if child_account.id in self.unreconciliable_accounts:
102- # unreconciliable filter:
103- # do not display unreciliable account
104- continue
105- if self.account_ids and child_account.id not in self.account_ids:
106- continue # filtered account
107-
108- sql = """
109- SELECT count(id)
110- FROM account_move_line AS l
111- WHERE %s AND l.account_id = %%s
112- """ % (self.query)
113- if ccy:
114- sql += " and l.currency_id = %d" % (ccy.id, )
115- self.cr.execute(sql, (child_account.id,))
116- num_entry = self.cr.fetchone()[0] or 0
117- sold_account = self._sum_balance_account(child_account)
118- self.sold_accounts[child_account.id] = sold_account
119- if self.display_account == 'bal_movement':
120- if child_account.type != 'view' and num_entry <> 0:
121- res.append(child_account)
122- elif self.display_account == 'bal_solde':
123- if child_account.type != 'view' and num_entry <> 0:
124- if not currency_obj.is_zero(self.cr, self.uid, currency, sold_account):
125- res.append(child_account)
126- else:
127- if not ccy or (ccy and num_entry > 0):
128- res.append(child_account)
129-
130- return res or [account]
131-
132 def lines(self, node, initial_balance_mode=False):
133 res = []
134 if not node.is_move_level:

Subscribers

People subscribed via source and target branches

to all changes: