~taktik/openobject-addons/hui-extra-6.1

« back to all changes in this revision

Viewing changes to account_trial_balance_period_xls/report/trial_balance_period_xls.py

  • Committer: Luc De Meyer
  • Date: 2015-02-04 23:29:43 UTC
  • Revision ID: luc.demeyer@noviat.com-20150204232943-6wyqnunx9cmtqg2c
update account_trial_balance_period_xls

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#
4
4
#    OpenERP, Open Source Management Solution
5
5
#
6
 
#    Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
 
6
#    Copyright (c) 2014-now Noviat nv/sa (www.noviat.com).
7
7
#
8
8
#    This program is free software: you can redistribute it and/or modify
9
9
#    it under the terms of the GNU Affero General Public License as
214
214
            if entry.get('top'):
215
215
                level_stack = [(x, account)]
216
216
            else:
217
 
                if (account.level > level_stack[-1][1].level and
218
 
                        account.parent_id == level_stack[-1][1]):
219
 
                    row_pos_table[level_stack[-1][0]].append(
220
 
                        x - level_stack[-1][0])
221
 
                    if account.type == 'view':
222
 
                        level_stack.append((x, account))
223
 
                else:
224
 
                    if account.type == 'view':
225
 
                        while level_stack[-1][1].level >= account.level:
226
 
                            level_stack.pop()
227
 
                        row_pos_table[level_stack[-1][0]].append(
228
 
                            x - level_stack[-1][0])
229
 
                        level_stack.append((x, account))
 
217
                for ls_i, ls_entry in enumerate(level_stack):
 
218
                    if account.parent_id == ls_entry[1]:
 
219
                        row_pos_table[level_stack[ls_i][0]].append(
 
220
                            x - level_stack[ls_i][0])
 
221
                        if account.type == 'view':
 
222
                            level_stack.append((x, account))
 
223
                        break
230
224
 
231
225
        for x, entry in enumerate(accounts_data):
232
226
            account = entry['account']
669
663
    'report.account.trial.balance.period.xls',
670
664
    'account.journal',
671
665
    parser=trial_balance_period_xls_parser)
672
 
 
673
 
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: