Merge lp:~luc-demeyer/account-financial-report/update-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: Yannick Vaucher @ Camptocamp
Approved revision: 66
Merged at revision: 79
Proposed branch: lp:~luc-demeyer/account-financial-report/update-account_journal_report_xls
Merge into: lp:~account-report-core-editor/account-financial-report/7.0
Diff against target: 488 lines (+169/-31)
9 files modified
account_journal_report_xls/__init__.py (+3/-5)
account_journal_report_xls/__openerp__.py (+6/-7)
account_journal_report_xls/account_journal.py (+5/-0)
account_journal_report_xls/i18n/fr.po (+57/-2)
account_journal_report_xls/i18n/nl.po (+57/-2)
account_journal_report_xls/report/nov_account_journal.py (+15/-9)
account_journal_report_xls/report/nov_account_journal_xls.py (+20/-0)
account_journal_report_xls/wizard/__init__.py (+3/-3)
account_journal_report_xls/wizard/print_journal_wizard.py (+3/-3)
To merge this branch: bzr merge lp:~luc-demeyer/account-financial-report/update-account_journal_report_xls
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review, no tests Approve
Alexis de Lattre (community) code review Approve
Review via email: mp+202223@code.launchpad.net

Description of the change

Extra fields:

'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

To post a comment you must log in.
Revision history for this message
Alexis de Lattre (alexis-via) :
review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) :
review: Approve (code review, no tests)

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-19 18:36:26 +0000
4@@ -3,7 +3,7 @@
5 #
6 # OpenERP, Open Source Management Solution
7 #
8-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
9+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
10 #
11 # This program is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Affero General Public License as
13@@ -12,11 +12,11 @@
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU Affero General Public License for more details.
20 #
21 # You should have received a copy of the GNU Affero General Public License
22-# along with this program. If not, see <http://www.gnu.org/licenses/>.
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #
25 ##############################################################################
26
27@@ -28,6 +28,4 @@
28 import logging
29 logging.getLogger('openerp.module').warning('report_xls not available in addons path. account_financial_report_webkit_xls will not be usable')
30
31-
32-
33 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
34
35=== modified file 'account_journal_report_xls/__openerp__.py'
36--- account_journal_report_xls/__openerp__.py 2013-12-19 17:08:40 +0000
37+++ account_journal_report_xls/__openerp__.py 2014-01-19 18:36:26 +0000
38@@ -3,7 +3,7 @@
39 #
40 # OpenERP, Open Source Management Solution
41 #
42-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
43+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
44 #
45 # This program is free software: you can redistribute it and/or modify
46 # it under the terms of the GNU Affero General Public License as
47@@ -12,17 +12,17 @@
48 #
49 # This program is distributed in the hope that it will be useful,
50 # but WITHOUT ANY WARRANTY; without even the implied warranty of
51-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53 # GNU Affero General Public License for more details.
54 #
55 # You should have received a copy of the GNU Affero General Public License
56-# along with this program. If not, see <http://www.gnu.org/licenses/>.
57+# along with this program. If not, see <http://www.gnu.org/licenses/>.
58 #
59 ##############################################################################
60
61 {
62 'name': 'Financial Journal reports',
63- 'version': '0.1',
64+ 'version': '0.2',
65 'license': 'AGPL-3',
66 'author': 'Noviat',
67 'category': 'Accounting & Finance',
68@@ -47,9 +47,8 @@
69 'account_voucher',
70 'report_xls',
71 ],
72- 'demo_xml': [],
73- 'init_xml': [],
74- 'update_xml': [
75+ 'demo': [],
76+ 'data': [
77 'wizard/print_journal_wizard.xml',
78 ],
79 }
80
81=== modified file 'account_journal_report_xls/account_journal.py'
82--- account_journal_report_xls/account_journal.py 2013-12-19 17:08:40 +0000
83+++ account_journal_report_xls/account_journal.py 2014-01-19 18:36:26 +0000
84@@ -65,6 +65,11 @@
85 #'partner_ref', # res.partner,ref
86 #'move_ref', # account.move,ref
87 #'move_id', # account.move,id
88+ #'acc_name', # account.account,name
89+ #'journal', # account.journal,name
90+ #'journal_code', # account.journal,code
91+ #'analytic_account', # account.analytic.account,name
92+ #'analytic_account_code', # account.analytic.account,code
93 ]
94 return res
95
96
97=== modified file 'account_journal_report_xls/i18n/fr.po'
98--- account_journal_report_xls/i18n/fr.po 2013-12-18 20:08:12 +0000
99+++ account_journal_report_xls/i18n/fr.po 2014-01-19 18:36:26 +0000
100@@ -6,8 +6,8 @@
101 msgstr ""
102 "Project-Id-Version: OpenERP Server 6.1\n"
103 "Report-Msgid-Bugs-To: support@noviat.be\n"
104-"POT-Creation-Date: 2013-11-23 17:11:14.941000\n"
105-"PO-Revision-Date: 2013-11-23 17:11:14.941000\n"
106+"POT-Creation-Date: 2014-01-19 17:16:37.990000\n"
107+"PO-Revision-Date: 2014-01-19 17:16:37.990000\n"
108 "Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
109 "Language-Team: \n"
110 "MIME-Version: 1.0\n"
111@@ -121,11 +121,36 @@
112
113 #. module: account_journal_report_xls
114 #: report:nov.account.journal.print:0
115+msgid "Journal Items"
116+msgstr "Écritures comptables"
117+
118+#. module: account_journal_report_xls
119+#: report:nov.account.journal.print:0
120 msgid "Entry"
121 msgstr "Écriture"
122
123 #. module: account_journal_report_xls
124 #: report:nov.account.journal.print:0
125+msgid "Name"
126+msgstr "Nom"
127+
128+#. module: account_journal_report_xls
129+#: report:nov.account.journal.print:0
130+msgid "Reference"
131+msgstr "Référence"
132+
133+#. module: account_journal_report_xls
134+#: report:nov.account.journal.print:0
135+msgid "Effective Date"
136+msgstr "Date"
137+
138+#. module: account_journal_report_xls
139+#: report:nov.account.journal.print:0
140+msgid "Period"
141+msgstr "Période"
142+
143+#. module: account_journal_report_xls
144+#: report:nov.account.journal.print:0
145 msgid "Date"
146 msgstr "Date"
147
148@@ -136,6 +161,16 @@
149
150 #. module: account_journal_report_xls
151 #: report:nov.account.journal.print:0
152+msgid "Account Name"
153+msgstr "Description compte "
154+
155+#. module: account_journal_report_xls
156+#: report:nov.account.journal.print:0
157+msgid "Journal"
158+msgstr "Journal"
159+
160+#. module: account_journal_report_xls
161+#: report:nov.account.journal.print:0
162 msgid "Description"
163 msgstr "Description"
164
165@@ -181,6 +216,16 @@
166
167 #. module: account_journal_report_xls
168 #: report:nov.account.journal.print:0
169+msgid "Tax Code"
170+msgstr "Case TVA"
171+
172+#. module: account_journal_report_xls
173+#: report:nov.account.journal.print:0
174+msgid "Tax/Base Amount"
175+msgstr "Montant TVA/Base"
176+
177+#. module: account_journal_report_xls
178+#: report:nov.account.journal.print:0
179 msgid "VAT"
180 msgstr "TVA"
181
182@@ -211,6 +256,16 @@
183
184 #. module: account_journal_report_xls
185 #: report:nov.account.journal.print:0
186+msgid "Comp. Curr."
187+msgstr "Dev. Soc."
188+
189+#. module: account_journal_report_xls
190+#: report:nov.account.journal.print:0
191+msgid "Analytic Account"
192+msgstr "Compte analytique"
193+
194+#. module: account_journal_report_xls
195+#: report:nov.account.journal.print:0
196 msgid "Document"
197 msgstr "Document"
198
199
200=== modified file 'account_journal_report_xls/i18n/nl.po'
201--- account_journal_report_xls/i18n/nl.po 2013-12-18 20:08:12 +0000
202+++ account_journal_report_xls/i18n/nl.po 2014-01-19 18:36:26 +0000
203@@ -6,8 +6,8 @@
204 msgstr ""
205 "Project-Id-Version: OpenERP Server 6.1\n"
206 "Report-Msgid-Bugs-To: support@noviat.be\n"
207-"POT-Creation-Date: 2013-11-23 17:11:14.936000\n"
208-"PO-Revision-Date: 2013-11-23 17:11:14.936000\n"
209+"POT-Creation-Date: 2014-01-19 17:16:37.980000\n"
210+"PO-Revision-Date: 2014-01-19 17:16:37.980000\n"
211 "Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
212 "Language-Team: \n"
213 "MIME-Version: 1.0\n"
214@@ -121,11 +121,36 @@
215
216 #. module: account_journal_report_xls
217 #: report:nov.account.journal.print:0
218+msgid "Journal Items"
219+msgstr "Boekingsregels"
220+
221+#. module: account_journal_report_xls
222+#: report:nov.account.journal.print:0
223 msgid "Entry"
224 msgstr "Boeking"
225
226 #. module: account_journal_report_xls
227 #: report:nov.account.journal.print:0
228+msgid "Name"
229+msgstr "Naam"
230+
231+#. module: account_journal_report_xls
232+#: report:nov.account.journal.print:0
233+msgid "Reference"
234+msgstr "Referentie"
235+
236+#. module: account_journal_report_xls
237+#: report:nov.account.journal.print:0
238+msgid "Effective Date"
239+msgstr "Datum"
240+
241+#. module: account_journal_report_xls
242+#: report:nov.account.journal.print:0
243+msgid "Period"
244+msgstr "Periode"
245+
246+#. module: account_journal_report_xls
247+#: report:nov.account.journal.print:0
248 msgid "Date"
249 msgstr "Datum"
250
251@@ -136,6 +161,16 @@
252
253 #. module: account_journal_report_xls
254 #: report:nov.account.journal.print:0
255+msgid "Account Name"
256+msgstr "Omschrijving rekening"
257+
258+#. module: account_journal_report_xls
259+#: report:nov.account.journal.print:0
260+msgid "Journal"
261+msgstr "Dagboek"
262+
263+#. module: account_journal_report_xls
264+#: report:nov.account.journal.print:0
265 msgid "Description"
266 msgstr "Omschrijving"
267
268@@ -181,6 +216,16 @@
269
270 #. module: account_journal_report_xls
271 #: report:nov.account.journal.print:0
272+msgid "Tax Code"
273+msgstr "BTW vak"
274+
275+#. module: account_journal_report_xls
276+#: report:nov.account.journal.print:0
277+msgid "Tax/Base Amount"
278+msgstr "Bedrag BTW/Mvh"
279+
280+#. module: account_journal_report_xls
281+#: report:nov.account.journal.print:0
282 msgid "VAT"
283 msgstr "BTW"
284
285@@ -211,6 +256,16 @@
286
287 #. module: account_journal_report_xls
288 #: report:nov.account.journal.print:0
289+msgid "Comp. Curr."
290+msgstr "Bedr. Val."
291+
292+#. module: account_journal_report_xls
293+#: report:nov.account.journal.print:0
294+msgid "Analytic Account"
295+msgstr "Kostenplaats"
296+
297+#. module: account_journal_report_xls
298+#: report:nov.account.journal.print:0
299 msgid "Document"
300 msgstr "Document"
301
302
303=== modified file 'account_journal_report_xls/report/nov_account_journal.py'
304--- account_journal_report_xls/report/nov_account_journal.py 2013-12-23 21:36:43 +0000
305+++ account_journal_report_xls/report/nov_account_journal.py 2014-01-19 18:36:26 +0000
306@@ -3,7 +3,7 @@
307 #
308 # OpenERP, Open Source Management Solution
309 #
310-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
311+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
312 #
313 # This program is free software: you can redistribute it and/or modify
314 # it under the terms of the GNU Affero General Public License as
315@@ -12,11 +12,11 @@
316 #
317 # This program is distributed in the hope that it will be useful,
318 # but WITHOUT ANY WARRANTY; without even the implied warranty of
319-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
320+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
321 # GNU Affero General Public License for more details.
322 #
323 # You should have received a copy of the GNU Affero General Public License
324-# along with this program. If not, see <http://www.gnu.org/licenses/>.
325+# along with this program. If not, see <http://www.gnu.org/licenses/>.
326 #
327 ##############################################################################
328
329@@ -121,9 +121,12 @@
330
331 select_extra, join_extra, where_extra = j_obj._report_xls_query_extra(self.cr, self.uid, self.context)
332
333+ # SQL select for performance reasons, as a consequence, there are no field value translations.
334+ # If performance is no issue, you can adapt the _report_xls_template in an inherited module to add field value translations.
335 self.cr.execute("SELECT l.move_id AS move_id, l.id AS aml_id, "
336 "am.name AS move_name, coalesce(am.ref,'') AS move_ref, am.date AS move_date, "
337- "aa.id AS account_id, aa.code AS acc_code, "
338+ "aa.id AS account_id, aa.code AS acc_code, aa.name AS acc_name, "
339+ "aj.name AS journal, aj.code AS journal_code, "
340 "coalesce(rp.name,'') AS partner_name, coalesce(rp.ref,'') AS partner_ref, rp.id AS partner_id, "
341 "coalesce(l.name,'') AS aml_name, "
342 "l.date_maturity AS date_maturity, "
343@@ -131,6 +134,7 @@
344 "coalesce(atc.code,'') AS tax_code, atc.id AS tax_code_id, coalesce(l.tax_amount,0.0) AS tax_amount, "
345 "coalesce(l.debit,0.0) AS debit, coalesce(l.credit,0.0) AS credit, "
346 "coalesce(amr.name,'') AS reconcile, coalesce(amrp.name,'') AS reconcile_partial, "
347+ "ana.name AS an_acc_name, coalesce(ana.code,'') AS an_acc_code, "
348 "coalesce(l.amount_currency,0.0) AS amount_currency, "
349 "rc.id AS currency_id, rc.name AS currency_name, rc.symbol AS currency_symbol, "
350 "coalesce(ai.internal_number,'-') AS inv_number, coalesce(abs.name,'-') AS st_number, coalesce(av.number,'-') AS voucher_number "
351@@ -138,6 +142,7 @@
352 "FROM account_move_line l "
353 "INNER JOIN account_move am ON l.move_id = am.id "
354 "INNER JOIN account_account aa ON l.account_id = aa.id "
355+ "INNER JOIN account_journal aj ON l.journal_id = aj.id "
356 "INNER JOIN account_period ap ON l.period_id = ap.id "
357 "LEFT OUTER JOIN account_invoice ai ON ai.move_id = am.id "
358 "LEFT OUTER JOIN account_voucher av ON av.move_id = am.id "
359@@ -146,6 +151,7 @@
360 "LEFT OUTER JOIN account_tax_code atc ON l.tax_code_id = atc.id "
361 "LEFT OUTER JOIN account_move_reconcile amr ON l.reconcile_id = amr.id "
362 "LEFT OUTER JOIN account_move_reconcile amrp ON l.reconcile_partial_id = amrp.id "
363+ "LEFT OUTER JOIN account_analytic_account ana ON l.analytic_account_id = ana.id "
364 "LEFT OUTER JOIN res_currency rc ON l.currency_id = rc.id "
365 + join_extra +
366 "WHERE l.period_id IN %s AND l.journal_id = %s "
367@@ -165,6 +171,10 @@
368 #_logger.warn('code_string= %s', code_string)
369 [x.update({'docname': eval(code_string) or '-'}) for x in lines]
370
371+ # group lines
372+ if self.group_entries:
373+ lines = self._group_lines(lines)
374+
375 # format debit, credit, amount_currency for pdf report
376 if self.display_currency and self.report_type == 'pdf':
377 curr_obj = self.pool.get('res.currency')
378@@ -175,10 +185,6 @@
379 else:
380 [x.update({'amount1': self.formatLang(x['debit']), 'amount2': self.formatLang(x['credit'])}) for x in lines]
381
382- # group lines
383- if self.group_entries:
384- lines = self._group_lines(lines)
385-
386 # insert a flag in every move_line to indicate the end of a move
387 # this flag will be used to draw a full line between moves
388 for cnt in range(len(lines) - 1):
389@@ -215,7 +221,7 @@
390 grouped_lines = [lines_in[0]]
391 move_id = lines_in[0]['move_id']
392 line_cnt = len(lines_in)
393- for i in range(1,line_cnt):
394+ for i in range(1, line_cnt):
395 line = lines_in[i]
396 if line['move_id'] == move_id:
397 grouped_lines.append(line)
398
399=== modified file 'account_journal_report_xls/report/nov_account_journal_xls.py'
400--- account_journal_report_xls/report/nov_account_journal_xls.py 2013-12-19 17:08:40 +0000
401+++ account_journal_report_xls/report/nov_account_journal_xls.py 2014-01-19 18:36:26 +0000
402@@ -86,6 +86,10 @@
403 'header': [1, 12, 'text', _render("_('Account')")],
404 'lines': [1, 0, 'text', _render("l['acc_code']")],
405 'totals': [1, 0, 'text', None]},
406+ 'acc_name': {
407+ 'header': [1, 36, 'text', _render("_('Account Name')")],
408+ 'lines': [1, 0, 'text', _render("l['acc_name']")],
409+ 'totals': [1, 0, 'text', None]},
410 'aml_name': {
411 'header': [1, 42, 'text', _render("_('Description')")],
412 'lines': [1, 0, 'text', _render("l['aml_name']")],
413@@ -94,6 +98,22 @@
414 'header': [1, 12, 'text', _render("_('Period')")],
415 'lines': [1, 0, 'text', _render("l['period']")],
416 'totals': [1, 0, 'text', None]},
417+ 'journal': {
418+ 'header': [1, 20, 'text', _render("_('Journal')")],
419+ 'lines': [1, 0, 'text', _render("l['journal']")],
420+ 'totals': [1, 0, 'text', None]},
421+ 'journal_code': {
422+ 'header': [1, 10, 'text', _render("_('Journal')")],
423+ 'lines': [1, 0, 'text', _render("l['journal_code']")],
424+ 'totals': [1, 0, 'text', None]},
425+ 'analytic_account': {
426+ 'header': [1, 20, 'text', _render("_('Analytic Account')")],
427+ 'lines': [1, 0, 'text', _render("l['an_acc_name']")],
428+ 'totals': [1, 0, 'text', None]},
429+ 'analytic_account_code': {
430+ 'header': [1, 20, 'text', _render("_('Analytic Account')")],
431+ 'lines': [1, 0, 'text', _render("l['an_acc_code']")],
432+ 'totals': [1, 0, 'text', None]},
433 'partner_name': {
434 'header': [1, 36, 'text', _render("_('Partner')")],
435 'lines': [1, 0, 'text', _render("l['partner_name']")],
436
437=== modified file 'account_journal_report_xls/wizard/__init__.py'
438--- account_journal_report_xls/wizard/__init__.py 2013-12-18 20:08:12 +0000
439+++ account_journal_report_xls/wizard/__init__.py 2014-01-19 18:36:26 +0000
440@@ -3,7 +3,7 @@
441 #
442 # OpenERP, Open Source Management Solution
443 #
444-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
445+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
446 #
447 # This program is free software: you can redistribute it and/or modify
448 # it under the terms of the GNU Affero General Public License as
449@@ -12,11 +12,11 @@
450 #
451 # This program is distributed in the hope that it will be useful,
452 # but WITHOUT ANY WARRANTY; without even the implied warranty of
453-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
454+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
455 # GNU Affero General Public License for more details.
456 #
457 # You should have received a copy of the GNU Affero General Public License
458-# along with this program. If not, see <http://www.gnu.org/licenses/>.
459+# along with this program. If not, see <http://www.gnu.org/licenses/>.
460 #
461 ##############################################################################
462
463
464=== modified file 'account_journal_report_xls/wizard/print_journal_wizard.py'
465--- account_journal_report_xls/wizard/print_journal_wizard.py 2013-12-20 01:18:22 +0000
466+++ account_journal_report_xls/wizard/print_journal_wizard.py 2014-01-19 18:36:26 +0000
467@@ -3,7 +3,7 @@
468 #
469 # OpenERP, Open Source Management Solution
470 #
471-# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
472+# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
473 #
474 # This program is free software: you can redistribute it and/or modify
475 # it under the terms of the GNU Affero General Public License as
476@@ -12,11 +12,11 @@
477 #
478 # This program is distributed in the hope that it will be useful,
479 # but WITHOUT ANY WARRANTY; without even the implied warranty of
480-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
481+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
482 # GNU Affero General Public License for more details.
483 #
484 # You should have received a copy of the GNU Affero General Public License
485-# along with this program. If not, see <http://www.gnu.org/licenses/>.
486+# along with this program. If not, see <http://www.gnu.org/licenses/>.
487 #
488 ##############################################################################
489