From 2cc265aaef420d20bfb1bc5b7b57e397276ab755 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Tue, 26 Oct 2010 11:13:51 +0530 Subject: [PATCH] [REF] Account: Remove some warnings from buildbot bzr revid: mra@mra-laptop-20101026054351-68olcwfpq81rinr2 --- addons/account/report/account_partner_balance.py | 1 - addons/account/report/account_profit_loss.py | 1 - addons/account/report/account_tax_code.py | 2 +- addons/account/report/rml_parse.py | 12 +++++------- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/addons/account/report/account_partner_balance.py b/addons/account/report/account_partner_balance.py index ab1c6f656f2..ab3cfd70970 100644 --- a/addons/account/report/account_partner_balance.py +++ b/addons/account/report/account_partner_balance.py @@ -79,7 +79,6 @@ class partner_balance(report_sxw.rml_parse, common_report_header): move_state = ['posted'] full_account = [] - result_tmp = 0.0 self.cr.execute( "SELECT p.ref,l.account_id,ac.name AS account_name,ac.code AS code,p.name, sum(debit) AS debit, sum(credit) AS credit, " \ "CASE WHEN sum(debit) > sum(credit) " \ diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py index 9469c3e0d7e..0bfaea7a570 100644 --- a/addons/account/report/account_profit_loss.py +++ b/addons/account/report/account_profit_loss.py @@ -77,7 +77,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header): db_pool = pooler.get_pool(self.cr.dbname) account_pool = db_pool.get('account.account') - year_pool = db_pool.get('account.fiscalyear') types = [ 'expense', diff --git a/addons/account/report/account_tax_code.py b/addons/account/report/account_tax_code.py index e59839f8267..42bbe305381 100644 --- a/addons/account/report/account_tax_code.py +++ b/addons/account/report/account_tax_code.py @@ -21,9 +21,9 @@ ############################################################################## import time + import rml_parse from report import report_sxw -import re def _get_country(record): if record.partner_id \ diff --git a/addons/account/report/rml_parse.py b/addons/account/report/rml_parse.py index c71c0254849..aab5e14c777 100644 --- a/addons/account/report/rml_parse.py +++ b/addons/account/report/rml_parse.py @@ -19,7 +19,6 @@ # ############################################################################## -import time import re import sys @@ -55,15 +54,15 @@ class rml_parse(report_sxw.rml_parse): ellipsis = ellipsis or '' try: return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen] - except Exception, e: + except: return False def _strip_name(self, name, maxlen=50): return self._ellipsis(name, maxlen, '...') - def _get_and_change_date_format_for_swiss (self,date_to_format): + def _get_and_change_date_format_for_swiss(self,date_to_format): date_formatted='' if date_to_format: - date_formatted = strptime (date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y') + date_formatted = strptime(date_to_format,'%Y-%m-%d').strftime('%d.%m.%Y') return date_formatted def _explode_name(self,chaine,length): @@ -109,15 +108,14 @@ class rml_parse(report_sxw.rml_parse): i = i + length chaine = str("".join(ast)) return chaine - def repair_string(self,chaine): + def repair_string(self, chaine): ast = list(chaine) UnicodeAst = [] - _previouslyfound = False i = 0 while i < len(ast): elem = ast[i] try: - Stringer = elem.encode("utf-8") + elem.encode("utf-8") except UnicodeDecodeError: to_reencode = elem + ast[i+1] print str(to_reencode)