Merge lp:~openerp-dev/openobject-addons/6.0-account-central_general_report_fixes-nep into lp:openobject-addons/6.0

Proposed by Nehal Panchal (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-account-central_general_report_fixes-nep
Merge into: lp:openobject-addons/6.0
Diff against target: 38 lines (+10/-4)
2 files modified
account/report/account_central_journal.py (+9/-3)
account/report/account_central_journal.rml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-account-central_general_report_fixes-nep
Reviewer Review Type Date Requested Status
Jay Vora (Serpent Consulting Services) (community) Approve
Review via email: mp+70712@code.launchpad.net

Description of the change

Hello ,

"Centralizing journals" Report prints double entry for account of the Journal.

Thank You.

To post a comment you must log in.
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) :
review: Approve

Unmerged revisions

4757. By Nehal Panchal (OpenERP)

[FIX] account : Improve Centralizing journals Report for grouping the entries as per journals

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/report/account_central_journal.py'
2--- account/report/account_central_journal.py 2011-01-14 00:11:01 +0000
3+++ account/report/account_central_journal.py 2011-08-08 09:57:32 +0000
4@@ -66,12 +66,18 @@
5 self.period_ids, self.journal_ids = zip(*res)
6 return super(journal_print, self).set_context(objects, data, ids, report_type=report_type)
7
8- def lines(self, period_id, journal_id):
9+ def lines(self, period_id, journal_id, amount_currency):
10 move_state = ['draft','posted']
11 if self.target_move == 'posted':
12 move_state = ['posted']
13-
14- self.cr.execute('SELECT a.currency_id, a.code, a.name, c.symbol AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \
15+ if not amount_currency:
16+ self.cr.execute('SELECT a.code, a.name, SUM(debit) AS debit, SUM(credit) AS credit \
17+ from account_move_line l \
18+ LEFT JOIN account_move am ON (l.move_id=am.id) \
19+ LEFT JOIN account_account a ON (l.account_id=a.id) \
20+ LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name', (tuple(move_state), period_id, journal_id))
21+ else:
22+ self.cr.execute('SELECT a.currency_id, a.code, a.name, c.symbol AS currency_code, l.currency_id, COALESCE(SUM(l.amount_currency),0.00) as amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \
23 from account_move_line l \
24 LEFT JOIN account_move am ON (l.move_id=am.id) \
25 LEFT JOIN account_account a ON (l.account_id=a.id) \
26
27=== modified file 'account/report/account_central_journal.rml'
28--- account/report/account_central_journal.rml 2011-01-14 00:11:01 +0000
29+++ account/report/account_central_journal.rml 2011-08-08 09:57:32 +0000
30@@ -313,7 +313,7 @@
31 </tr>
32 </blockTable>
33 <section>
34- <para style="terp_default_8">[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]]</para>
35+ <para style="terp_default_8">[[ repeatIn(lines(o.period_id.id,o.journal_id.id,data['form']['amount_currency']),'line') ]]</para>
36 <blockTable colWidths="50.0,240.0,85.0,85.0,90.0" style="Table_Journal_Line_Content">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
37 <tr>
38 <td><para style="terp_default_9">[[ line['code'] ]]</para></td>