~equipovision/account-financial-report/trunk

« back to all changes in this revision

Viewing changes to account_journal_report_xls/report/nov_account_journal.py

  • Committer: Guewen Baconnier
  • Author(s): Luc De Meyer
  • Date: 2014-01-31 15:19:27 UTC
  • mfrom: (65.2.2 bugfix-account_journal_report_xls)
  • Revision ID: guewen.baconnier@camptocamp.com-20140131151927-7bgsiq61ho15dxnq
This update fixes a bug in the PDF report when using the 'Group Entries' option (this bug doesn't exist in the XLS variant of this report)

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) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
 
6
#    Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
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
12
12
#
13
13
#    This program is distributed in the hope that it will be useful,
14
14
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
#    GNU Affero General Public License for more details.
17
17
#
18
18
#    You should have received a copy of the GNU Affero General Public License
19
 
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
#    along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
#
21
21
##############################################################################
22
22
 
165
165
            #_logger.warn('code_string= %s', code_string)
166
166
            [x.update({'docname': eval(code_string) or '-'}) for x in lines]
167
167
 
 
168
        # group lines
 
169
        if self.group_entries:
 
170
            lines = self._group_lines(lines)
 
171
 
168
172
        # format debit, credit, amount_currency for pdf report
169
173
        if self.display_currency and self.report_type == 'pdf':
170
174
            curr_obj = self.pool.get('res.currency')
175
179
        else:
176
180
            [x.update({'amount1': self.formatLang(x['debit']), 'amount2': self.formatLang(x['credit'])}) for x in lines]
177
181
 
178
 
        # group lines
179
 
        if self.group_entries:
180
 
            lines = self._group_lines(lines)
181
 
 
182
182
        # insert a flag in every move_line to indicate the end of a move
183
183
        # this flag will be used to draw a full line between moves
184
184
        for cnt in range(len(lines) - 1):
215
215
        grouped_lines = [lines_in[0]]
216
216
        move_id = lines_in[0]['move_id']
217
217
        line_cnt = len(lines_in)
218
 
        for i in range(1,line_cnt):
 
218
        for i in range(1, line_cnt):
219
219
            line = lines_in[i]
220
220
            if line['move_id'] == move_id:
221
221
                grouped_lines.append(line)