[IMP]:account:added strip_name function in general ledger report.

bzr revid: apa@tinyerp.com-20101026094840-k7eoajbkipno8k1u
This commit is contained in:
apa-tiny
2010-10-26 15:18:40 +05:30
parent fe32b72179
commit 8bd4923b9b
@@ -86,9 +86,20 @@ class general_ledger(report_sxw.rml_parse, common_report_header):
'get_start_date':self._get_start_date,
'get_end_date':self._get_end_date,
'get_target_move': self._get_target_move,
'strip_name': self._strip_name,
})
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 _strip_name(self, name, maxlen=50):
return self._ellipsis(name, maxlen, ' ...')
def _sum_currency_amount_account(self, account):
self.cr.execute('SELECT sum(l.amount_currency) AS tot_currency \
FROM account_move_line l \