[IMP] hr_payroll: better name class for browsable object in python code of salary rules

bzr revid: qdp-launchpad@openerp.com-20110523140926-388dp1b8egyt08zl
This commit is contained in:
Quentin (OpenERP) 2011-05-23 16:09:26 +02:00
parent 16228651c6
commit 00384b71e5
1 changed files with 5 additions and 4 deletions

View File

@ -473,8 +473,7 @@ class hr_payslip(osv.osv):
localdict['categories'][category.code] = category.code in localdict['categories'] and localdict['categories'][category.code] + amount or amount
return localdict
class InputLine(object):
"""a class that will be used into the python code, mainly for usability purposes"""
class BrowsableObject(object):
def __init__(self, pool, cr, uid, employee_id, dict):
self.pool = pool
self.cr = cr
@ -485,6 +484,8 @@ class hr_payslip(osv.osv):
def __getattr__(self, attr):
return self.dict.__getitem__(attr)
class InputLine(BrowsableObject):
"""a class that will be used into the python code, mainly for usability purposes"""
def sum(self, code, from_date, to_date=None):
if to_date is None:
to_date = datetime.now().strftime('%Y-%m-%d')
@ -497,7 +498,7 @@ class hr_payslip(osv.osv):
res = self.cr.fetchone()[0]
return res or 0.0
class WorkedDays(InputLine):
class WorkedDays(BrowsableObject):
"""a class that will be used into the python code, mainly for usability purposes"""
def _sum(self, code, from_date, to_date=None):
if to_date is None:
@ -518,7 +519,7 @@ class hr_payslip(osv.osv):
res = self._sum(code, from_date, to_date)
return res and res[1] or 0.0
class Payslips(InputLine):
class Payslips(BrowsableObject):
"""a class that will be used into the python code, mainly for usability purposes"""
def sum(self, code, from_date, to_date=None):