mirror of
https://bitbucket.org/presik/trytonpsk-staff_payroll_co.git
synced 2023-12-14 06:42:56 +01:00
minor fix
This commit is contained in:
parent
caef1c3e76
commit
f70f9f7747
13
payroll.py
13
payroll.py
|
@ -84,6 +84,7 @@ class Payroll(metaclass=PoolMeta):
|
||||||
department = fields.Many2One('company.department', 'Department',
|
department = fields.Many2One('company.department', 'Department',
|
||||||
required=False, depends=['employee'])
|
required=False, depends=['employee'])
|
||||||
sended_mail = fields.Boolean('Sended Email')
|
sended_mail = fields.Boolean('Sended Email')
|
||||||
|
worked_days_effective = fields.Function(fields.Numeric('Worked Days Effective'), 'get_worked_days_effective')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
|
@ -182,6 +183,14 @@ class Payroll(metaclass=PoolMeta):
|
||||||
if not self.description and self.period:
|
if not self.description and self.period:
|
||||||
self.description = self.period.description
|
self.description = self.period.description
|
||||||
|
|
||||||
|
def get_worked_days_effective(self, name=None):
|
||||||
|
if self.lines:
|
||||||
|
days = []
|
||||||
|
for l in self.lines:
|
||||||
|
if l.wage_type.wage_type.concept == 'salary':
|
||||||
|
days.append(l.quantity)
|
||||||
|
days = sum(days)
|
||||||
|
|
||||||
def adjust_partial_sunday(self, quantity):
|
def adjust_partial_sunday(self, quantity):
|
||||||
# Factor = 8 hour sunday / 6 days (monday-saturday)
|
# Factor = 8 hour sunday / 6 days (monday-saturday)
|
||||||
factor = 1.33
|
factor = 1.33
|
||||||
|
@ -338,8 +347,8 @@ class Payroll(metaclass=PoolMeta):
|
||||||
PayrollLine = pool.get('staff.payroll.line')
|
PayrollLine = pool.get('staff.payroll.line')
|
||||||
staff_loan = False
|
staff_loan = False
|
||||||
Module = Pool().get('ir.module')
|
Module = Pool().get('ir.module')
|
||||||
module, = Module.search(['name', '=', 'staff_loan'])
|
modules = Module.search(['name', '=', 'staff_loan'])
|
||||||
if module.state == 'activated':
|
if modules and modules[0].state == 'activated':
|
||||||
staff_loan = True
|
staff_loan = True
|
||||||
LoanLine = pool.get('staff.loan.line')
|
LoanLine = pool.get('staff.loan.line')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue