[REF]hr_payroll: code cleaning.

bzr revid: vra@tinyerp.com-20101015070929-k7p1wvy3fl2az1s3
This commit is contained in:
vra 2010-10-15 12:39:29 +05:30
parent 2a77b86cd1
commit af37d56800
5 changed files with 4 additions and 40 deletions

View File

@ -24,7 +24,6 @@
import time
from report import report_sxw
from tools import amount_to_text_en
class salary_structure_report(report_sxw.rml_parse):

View File

@ -1,7 +1,6 @@
import time
from datetime import datetime
from report import report_sxw
from tools import amount_to_text_en
class report_payroll_register(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):

View File

@ -22,7 +22,6 @@
#
##############################################################################
import time
from datetime import datetime
from report import report_sxw
from tools import amount_to_text_en

View File

@ -1,5 +1,3 @@
import time
import locale
import datetime
from report import report_sxw
import time
@ -51,7 +49,6 @@ class year_salary_report(rml_parse.rml_parse):
def get_employee(self,form):
ls1=[]
ls = []
periods = []
tol_mnths=['Total',0,0,0,0,0,0,0,0,0,0,0,0]
emp = pooler.get_pool(self.cr.dbname).get('hr.employee')
emp_ids = form['employee_ids']

View File

@ -20,16 +20,10 @@
#
##############################################################################
from report import report_sxw
import xml.dom.minidom
import os, time
import osv
import re
import tools
import pooler
import re
import sys
from lxml import etree
from time import strptime
class rml_parse(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
@ -56,12 +50,14 @@ class rml_parse(report_sxw.rml_parse):
return new
else:
return self.comma_me(new)
def _ellipsis(self, string, maxlen=100, ellipsis = '...'):
ellipsis = ellipsis or ''
try:
return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen]
except Exception, e:
except Exception:
return False
def _strip_name(self, name, maxlen=50):
return self._ellipsis(name, maxlen, '...')
@ -106,20 +102,9 @@ class rml_parse(report_sxw.rml_parse):
return Stringer
return Stringer
def explode_this(self,chaine,length):
chaine = rstrip(chaine)
ast = list(chaine)
i = length
while i <= len(ast):
ast.insert(i,'\n')
i = i + length
chaine = str("".join(ast))
return chaine
def repair_string(self,chaine):
ast = list(chaine)
UnicodeAst = []
_previouslyfound = False
i = 0
while i < len(ast):
elem = ast[i]
@ -136,21 +121,6 @@ class rml_parse(report_sxw.rml_parse):
i += i + 1
return "".join(UnicodeAst)
def ReencodeAscii(self,str):
print sys.stdin.encoding
try:
Stringer = str.decode("ascii")
except UnicodeEncodeError:
print "REENCODING ERROR"
return str.encode("ascii")
except UnicodeDecodeError:
print "DECODING ERROR"
return str.encode("ascii")
else:
print Stringer
return Stringer
def _add_header(self, node, header='external'):
if header=='internal':
rml_head = self.rml_header2