diff options
| author | sbh (Open ERP) <sbh@tinyerp.com> | 2010-07-16 16:37:48 +0530 |
|---|---|---|
| committer | sbh (Open ERP) <sbh@tinyerp.com> | 2010-07-16 16:37:48 +0530 |
| commit | 9ecfe0c16c19c51ec7846e69e4ecf537ef8409e9 (patch) | |
| tree | 8a0a221420f7bec95d68e25cd030f6941264259e | |
| parent | 61aa9034d69a73e5e2690ab01e18e6851cffb901 (diff) | |
[IMP] account: Improve the account report
bzr revid: sbh@tinyerp.com-20100716110748-6z4o4vkk9p3vwfoi
| -rw-r--r-- | addons/account/report/common_report_header.py | 5 | ||||
| -rw-r--r-- | addons/account/report/general_journal.py | 3 | ||||
| -rw-r--r-- | addons/account/report/general_journal.rml | 6 | ||||
| -rw-r--r-- | addons/account/report/general_ledger.py | 5 |
4 files changed, 12 insertions, 7 deletions
diff --git a/addons/account/report/common_report_header.py b/addons/account/report/common_report_header.py index 0b14b35c752..b8f3fb1c760 100644 --- a/addons/account/report/common_report_header.py +++ b/addons/account/report/common_report_header.py @@ -127,5 +127,10 @@ class common_report_header(object): if data.get('form', False) and data['form'].get('company_id', False): comp_obj = pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, data['form']['company_id']) return comp_obj.name + + def _get_journal(self, journal_ids): + self.cr.execute('select code from account_journal where id IN %s',(tuple(journal_ids),)) + codes = [x for x, in self.cr.fetchall()] + return codes or '' #vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file diff --git a/addons/account/report/general_journal.py b/addons/account/report/general_journal.py index 8c0f7e47e40..d3c793e5fb4 100644 --- a/addons/account/report/general_journal.py +++ b/addons/account/report/general_journal.py @@ -49,7 +49,8 @@ class journal_print(report_sxw.rml_parse, common_report_header): 'get_end_period': self.get_end_period, 'get_sortby': self._get_sortby, 'sum_currency_amount_account': self._sum_currency_amount_account, - 'get_filter': self._get_filter, + 'get_filter': self._get_filter, + 'get_journal': self._get_journal, }) def set_context(self, objects, data, ids, report_type=None): # Improve move to common default? diff --git a/addons/account/report/general_journal.rml b/addons/account/report/general_journal.rml index 5c2e625cbd1..04163556a8d 100644 --- a/addons/account/report/general_journal.rml +++ b/addons/account/report/general_journal.rml @@ -245,16 +245,18 @@ </td> </tr> </blockTable> - <blockTable colWidths="120.0,80.0,150.0,100.0" style="Table2"> + <blockTable colWidths="80.0,100,80.0,150.0,100.0" style="Table2"> <tr> <td><para style="terp_tblheader_General_Centre">Chat Account</para></td> <td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td> + <td><para style="terp_tblheader_General_Centre">Journals</para></td> <td><para style="terp_tblheader_General_Centre">Filters By <font>[[ get_filter(data)!='No Filter' and '' or removeParentNode('font') ]]</font></para></td> <td><para style="terp_tblheader_General_Centre">Printing Date</para></td> </tr> <tr> <td><para style="terp_default_Centre_8">[[ get_account(data) or removeParentNode('para') ]]</para></td> <td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or removeParentNode('para') ]]</para></td> + <td> <para style="terp_default_Centre_8">[[', '.join([ lt or '' for lt in get_journal(data['form']['journal_ids']) ]) ]] </para></td> <td><para style="terp_default_Centre_8">[[ get_filter(data)=='No Filter' and get_filter(data) or removeParentNode('para') ]] </para> <blockTable colWidths="60.0,60.0" style="Table3">[[ get_filter(data)=='Date' or removeParentNode('blockTable') ]] <tr> @@ -319,7 +321,7 @@ <td><para style="terp_default_Bold_9_Right">[[ formatLang(sum_debit()) ]]</para></td> <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_credit()) ]]</para></td> <td><para style="terp_default_Bold_9_Right">[[ formatLang( sum_debit()- sum_credit()) ]]</para></td> - <td><para style="terp_default_Bold_9_Right"><u>[[ o.currency_id and formatLang(sum_currency_amount_account(o, data['form'])) +o.currency_id.code or '' ]]</u></para></td> + <td><para style="terp_default_Bold_9_Right"><u>[[ formatLang(sum_currency_amount_account(o, data['form'])) or '' ]]</u></para></td> </tr> </blockTable> diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 8b7a79c3cca..b232b5f7c59 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -227,10 +227,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header): # Add initial balance to the result sum_currency += self.cr.fetchone()[0] or 0.0 return str(sum_currency) - def _get_journal(self, journal_ids): - self.cr.execute('select code from account_journal where id IN %s',(tuple(journal_ids),)) - codes = [x for x, in self.cr.fetchall()] - return codes or '' + report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header='internal') report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/general_ledger_landscape.rml', parser=general_ledger, header='internal') |
