diff options
| author | qdp-launchpad@tinyerp.com <> | 2010-11-22 17:23:48 +0100 |
|---|---|---|
| committer | qdp-launchpad@tinyerp.com <> | 2010-11-22 17:23:48 +0100 |
| commit | 4c8a58015ae2edfc87e5e65dce1b651a21e26f1d (patch) | |
| tree | 5841d2e5d8509bb12f5a3da77548d5d9d8b2ebcb | |
| parent | fea21cc0f7c50f35729604bbf4e0d9b1e15651ed (diff) | |
[FIX] account, general ledger report: fixed the strip_name function
bzr revid: qdp-launchpad@tinyerp.com-20101122162348-paxq56r4wj6mtjqn
| -rw-r--r-- | addons/account/report/account_general_ledger.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index 6ccfb9343a2..4656987cbeb 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -90,15 +90,13 @@ class general_ledger(report_sxw.rml_parse, common_report_header): }) self.context = context - def _ellipsis(self, orig_str, maxlen=100, ellipsis='...'): - maxlen = maxlen - len(ellipsis) - if maxlen <= 0: - maxlen = 1 - new_str = orig_str[:maxlen] - return new_str + def _ellipsis(self, char, size=100, truncation_str='...'): + if len(char) <= size: + return char + return char[:size-len(truncation_str)] + truncation_str def _strip_name(self, name, maxlen=50): - return self._ellipsis(name, maxlen, ' ...') + return self._ellipsis(name, maxlen) def _sum_currency_amount_account(self, account): self.cr.execute('SELECT sum(l.amount_currency) AS tot_currency \ @@ -317,4 +315,4 @@ class general_ledger(report_sxw.rml_parse, common_report_header): report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger, header='internal') report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger, header='internal landscape') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
