diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index 82af01cdb0b..d43adeef2be 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -118,7 +118,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): if self.target_move == 'posted': move_state = ['posted'] - self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '',(tuple(move_state), period_id, tuple(journal_id) )) + self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + ', l.move_id',(tuple(move_state), period_id, tuple(journal_id) )) ids = map(lambda x: x[0], self.cr.fetchall()) return obj_mline.browse(self.cr, self.uid, ids) diff --git a/addons/account/report/account_journal.rml b/addons/account/report/account_journal.rml index c2807a2e8a2..a81c634ddc8 100644 --- a/addons/account/report/account_journal.rml +++ b/addons/account/report/account_journal.rml @@ -128,22 +128,14 @@ - - - - - - - - - - - - - - - - + + + + + + + + @@ -151,23 +143,21 @@ - + - - - - - - - + + + + + - - + + - + @@ -175,10 +165,9 @@ - - - - + + + @@ -196,117 +185,119 @@ - [[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]] - [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] + [[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]] + [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]] Fiscal Year - Journal + Journal Filters By Entries Sorted By Target Moves - - [[ get_account(data) or '' ]] + + [[ get_account(data) or '' ]] [[ get_fiscalyear(data) or '' ]] - [[o.journal_id.name ]] + [[o.journal_id.name ]] [[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] - [[ get_filter(data)=='Date' or removeParentNode('blockTable') ]] - - Start Date - End Date - - - [[ formatLang(get_start_date(data),date=True) ]] - [[ formatLang(get_end_date(data),date=True) ]] - - - [[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]] - - Start Period - End Period - - - [[ get_start_period(data) or removeParentNode('para') ]] - [[ get_end_period(data) or removeParentNode('para') ]] - - - + [[ get_filter(data)=='Date' or removeParentNode('blockTable') ]] + + Start Date + End Date + + + [[ formatLang(get_start_date(data),date=True) ]] + [[ formatLang(get_end_date(data),date=True) ]] + + + [[ get_filter(data)=='Periods' or removeParentNode('blockTable') ]] + + Start Period + End Period + + + [[ get_start_period(data) or removeParentNode('para') ]] + [[ get_end_period(data) or removeParentNode('para') ]] + + + [[ get_sortby(data) ]] - [[ get_target_move(data) ]] - - + [[ get_target_move(data) ]] + + - [[ display_currency(data) == False or removeParentNode('blockTable') ]] + [[ display_currency(data) == False or removeParentNode('blockTable') ]] Date - Entry No - A/c No. + Ref + Move + Account Partner - Move/Entry Label + Label Debit Credit - Balance [[o.period_id.name ]] - [[ o.journal_id.code ]] + [[ o.journal_id.code ]] - [[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]] - [[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]] - [[ formatLang((sum_credit(o.period_id.id, o.journal_id.id)-sum_debit(o.period_id.id, o.journal_id.id))) ]] [[ company.currency_id.symbol ]] + + [[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]] + [[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]] [[lines(o.period_id.id, o.journal_id.id) or removeParentNode('story') ]] [[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]][[ formatLang(line.date,date=True) ]] - [[ line.ref ]] - [[ line.account_id.code ]] - [[ line.partner_id and line.partner_id.name ]] - [[ line.move_id.name ]] - [[ line.name ]] - [[ formatLang(line.debit) ]] - [[ formatLang(line.credit) ]] - [[ formatLang(line.credit - line.debit) ]] [[ company.currency_id.symbol ]] + [[ strip_name(line.ref,20) ]] + [[ line.move_id.name <> '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]] + [[ line.account_id.code ]] + [[ line.partner_id and strip_name(line.partner_id.name,16) ]] + [[ strip_name(line.name,35) ]] + [[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]] - [[ display_currency(data) or removeParentNode('blockTable') ]] + [[ display_currency(data) or removeParentNode('blockTable') ]] Date - Entry No - A/c No. + Ref + Move + Account Partner - Move/Entry Label + Label Debit Credit - Balance - Currency + Currency [[o.period_id.name ]] - [[ o.journal_id.code ]] + [[ o.journal_id.code ]] - [[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]] - [[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]] - [[ formatLang((sum_debit(o.period_id.id, o.journal_id.id) - sum_credit(o.period_id.id, o.journal_id.id))) ]] [[ company.currency_id.symbol ]] + + [[ formatLang(sum_debit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]] + [[ formatLang(sum_credit(o.period_id.id, o.journal_id.id)) ]] [[ company.currency_id.symbol ]] + + [[lines(o.period_id.id, o.journal_id.id) or removeParentNode('story') ]] [[ repeatIn(lines(o.period_id.id, o.journal_id.id), 'line') ]][[ formatLang(line.date,date=True) ]] - [[ line.ref ]] - [[ line.account_id.code ]] - [[ line.partner_id and line.partner_id.name ]] - [[ line.move_id.name ]] - [[ line.name ]] - [[ formatLang(line.debit) ]] - [[ formatLang(line.credit) ]] - [[ formatLang(line.credit - line.debit) ]] [[ company.currency_id.symbol ]] - [[ line.currency_id and formatLang(line.amount_currency) or '' ]] [[ line.currency_id.symbol or '']] + [[ strip_name(line.ref,20) ]] + [[ line.move_id.name <> '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]] + [[ line.account_id.code ]] + [[ line.partner_id and strip_name(line.partner_id.name,16) ]] + [[ strip_name(line.name,17) ]] + [[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]] + [[ line.currency_id and formatLang(line.amount_currency) or '' ]] [[ line.currency_id.symbol or '']]