minor fix create line payrolls

This commit is contained in:
wilson gomez 2021-09-10 11:49:54 -05:00
parent e44b3cafaa
commit fba19a8b52

View file

@ -332,7 +332,8 @@ class Payroll(metaclass=PoolMeta):
])
lines_to_reconcile = []
values = []
if line.wage_type.type_concept == 'holidays':
res = self.validate_wage_type(line, concept='holidays')
if res == 'holidays':
amount = line.amount
for m in move_lines:
values.append(abs(m.debit - m.credit))
@ -353,6 +354,16 @@ class Payroll(metaclass=PoolMeta):
'move_lines': [('add', lines_to_reconcile)]
})
def validate_wage_type(self, line, concept=None):
if concept == 'holidays':
Event = Pool().get('staff.event')
event, = Event.search([
('employee', '=', self.employee),
('state', '=', 'done'),
('line_payroll', '=', line.id)
])
return 'holidays'
def search_salary_month(self, wage):
res = _ZERO
payrolls = self._get_payrolls_month()