Merge lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls into lp:~account-report-core-editor/account-financial-report/7.0

Proposed by Luc De Meyer (Noviat)
Status: Merged
Approved by: Guewen Baconnier @ Camptocamp
Approved revision: 67
Merged at revision: 68
Proposed branch: lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls
Merge into: lp:~account-report-core-editor/account-financial-report/7.0
Diff against target: 107 lines (+13/-16)
3 files modified
account_journal_report_xls/__init__.py (+0/-2)
account_journal_report_xls/__openerp__.py (+5/-6)
account_journal_report_xls/report/nov_account_journal.py (+8/-8)
To merge this branch: bzr merge lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls
Reviewer Review Type Date Requested Status
Alexis de Lattre (community) code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+201660@code.launchpad.net

This proposal supersedes a proposal from 2014-01-13.

Description of the change

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).

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote : Posted in a previous version of this proposal

Hi, Luc,

Can you please update your branch before making the MP? You have missed last revision.

Regards.

review: Needs Fixing
Revision history for this message
Luc De Meyer (Noviat) (luc-demeyer) wrote : Posted in a previous version of this proposal

I effectively missed the try/except addition in the module __init__.py
I have added this and resubmitted the merge.

Regards,
Luc

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Pedro Manuel Baeza
Sent: maandag 13 januari 2014 23:48
To: <email address hidden>
Subject: Re: [Merge] lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls into lp:account-financial-report

Review: Needs Fixing

Hi, Luc,

Can you please update your branch before making the MP? You have missed last revision.

Regards.
--
https://code.launchpad.net/~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls/+merge/201511
You are the owner of lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

OK, now it looks good. Thank you.

Regards.

review: Approve (code review)
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

By the way (but it is not the topic of this merge proposal), I think that we need to have the "Analytic account" field available in the module account_journal_report_xls (it is now available in the module account_move_line_report_xls)... I looked into the code, and this field doesn't seem to be available for the moment.

Revision history for this message
Luc De Meyer (Noviat) (luc-demeyer) wrote :

It's a 5 minutes job to add this field.
I haven't received this concrete question yet from our customer base, hence if we add this field, we probably should keep it out of the defaults list.

Regards,
Luc

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Alexis de Lattre
Sent: woensdag 15 januari 2014 10:57
To: <email address hidden>
Subject: Re: [Merge] lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls into lp:account-financial-report

By the way (but it is not the topic of this merge proposal), I think that we need to have the "Analytic account" field available in the module account_journal_report_xls (it is now available in the module account_move_line_report_xls)... I looked into the code, and this field doesn't seem to be available for the moment.
--
https://code.launchpad.net/~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls/+merge/201660
You are the owner of lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls.

Revision history for this message
Alexis de Lattre (alexis-via) wrote :

@Luc

I am surprised that your customer base never asked for analytic account in the journal export. Most of my customers use analytic accounting and your module account_journal_report_xls export is quite convenient to export journals to another accounting software (for the customers who have an external accountant).

If it's a 5 minutes job to add analytic account, let's do it :) It's not a problem if it's not in the default list, as it's easy to modify via inheritance. A second field would be convenient for me : the journal code (no need to put it in the default list, because we already have a tab per journal).

Revision history for this message
Luc De Meyer (Noviat) (luc-demeyer) wrote :

I have added following fields via new merge proposal:

'acc_name', # account.account,name
'journal', # account.journal,name
'journal_code', # account.journal,code
'analytic_account', # account.analytic.account,name
'analytic_account_code', # account.analytic.account,code

Regards,
Luc

-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Alexis de Lattre
Sent: vrijdag 17 januari 2014 11:41
To: <email address hidden>
Subject: Re: [Merge] lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls into lp:account-financial-report

@Luc

I am surprised that your customer base never asked for analytic account in the journal export. Most of my customers use analytic accounting and your module account_journal_report_xls export is quite convenient to export journals to another accounting software (for the customers who have an external accountant).

If it's a 5 minutes job to add analytic account, let's do it :) It's not a problem if it's not in the default list, as it's easy to modify via inheritance. A second field would be convenient for me : the journal code (no need to put it in the default list, because we already have a tab per journal).
--
https://code.launchpad.net/~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls/+merge/201660
You are the owner of lp:~luc-demeyer/account-financial-report/bugfix-account_journal_report_xls.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_journal_report_xls/__init__.py'
2--- account_journal_report_xls/__init__.py 2014-01-08 11:49:48 +0000
3+++ account_journal_report_xls/__init__.py 2014-01-14 19:42:45 +0000
4@@ -28,6 +28,4 @@
5 import logging
6 logging.getLogger('openerp.module').warning('report_xls not available in addons path. account_financial_report_webkit_xls will not be usable')
7
8-
9-
10 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
11
12=== modified file 'account_journal_report_xls/__openerp__.py'
13--- account_journal_report_xls/__openerp__.py 2013-12-19 17:08:40 +0000
14+++ account_journal_report_xls/__openerp__.py 2014-01-14 19:42:45 +0000
15@@ -3,7 +3,7 @@
16 #
17 # OpenERP, Open Source Management Solution
18 #
19-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
20+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
21 #
22 # This program is free software: you can redistribute it and/or modify
23 # it under the terms of the GNU Affero General Public License as
24@@ -12,11 +12,11 @@
25 #
26 # This program is distributed in the hope that it will be useful,
27 # but WITHOUT ANY WARRANTY; without even the implied warranty of
28-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU Affero General Public License for more details.
31 #
32 # You should have received a copy of the GNU Affero General Public License
33-# along with this program. If not, see <http://www.gnu.org/licenses/>.
34+# along with this program. If not, see <http://www.gnu.org/licenses/>.
35 #
36 ##############################################################################
37
38@@ -47,9 +47,8 @@
39 'account_voucher',
40 'report_xls',
41 ],
42- 'demo_xml': [],
43- 'init_xml': [],
44- 'update_xml': [
45+ 'demo': [],
46+ 'data': [
47 'wizard/print_journal_wizard.xml',
48 ],
49 }
50
51=== modified file 'account_journal_report_xls/report/nov_account_journal.py'
52--- account_journal_report_xls/report/nov_account_journal.py 2013-12-23 21:36:43 +0000
53+++ account_journal_report_xls/report/nov_account_journal.py 2014-01-14 19:42:45 +0000
54@@ -3,7 +3,7 @@
55 #
56 # OpenERP, Open Source Management Solution
57 #
58-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
59+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
60 #
61 # This program is free software: you can redistribute it and/or modify
62 # it under the terms of the GNU Affero General Public License as
63@@ -12,11 +12,11 @@
64 #
65 # This program is distributed in the hope that it will be useful,
66 # but WITHOUT ANY WARRANTY; without even the implied warranty of
67-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
69 # GNU Affero General Public License for more details.
70 #
71 # You should have received a copy of the GNU Affero General Public License
72-# along with this program. If not, see <http://www.gnu.org/licenses/>.
73+# along with this program. If not, see <http://www.gnu.org/licenses/>.
74 #
75 ##############################################################################
76
77@@ -165,6 +165,10 @@
78 #_logger.warn('code_string= %s', code_string)
79 [x.update({'docname': eval(code_string) or '-'}) for x in lines]
80
81+ # group lines
82+ if self.group_entries:
83+ lines = self._group_lines(lines)
84+
85 # format debit, credit, amount_currency for pdf report
86 if self.display_currency and self.report_type == 'pdf':
87 curr_obj = self.pool.get('res.currency')
88@@ -175,10 +179,6 @@
89 else:
90 [x.update({'amount1': self.formatLang(x['debit']), 'amount2': self.formatLang(x['credit'])}) for x in lines]
91
92- # group lines
93- if self.group_entries:
94- lines = self._group_lines(lines)
95-
96 # insert a flag in every move_line to indicate the end of a move
97 # this flag will be used to draw a full line between moves
98 for cnt in range(len(lines) - 1):
99@@ -215,7 +215,7 @@
100 grouped_lines = [lines_in[0]]
101 move_id = lines_in[0]['move_id']
102 line_cnt = len(lines_in)
103- for i in range(1,line_cnt):
104+ for i in range(1, line_cnt):
105 line = lines_in[i]
106 if line['move_id'] == move_id:
107 grouped_lines.append(line)