Fix count

This commit is contained in:
Oscar 2021-11-10 21:26:17 -05:00
parent 7cbe2297c3
commit 5d85d7cd6c

View file

@ -796,12 +796,14 @@ class PayrollGroup(Wizard):
#Remove employees with payroll this period
payrolls_period = Payroll.search([
('period', '=', self.start.period.id),
('department', '=', self.start.department.id),
])
contracts_w_payroll = [p.contract.id for p in payrolls_period]
dom_employees = self.get_employees_dom(contracts_w_payroll)
payroll_to_create = []
employees = Employee.search(dom_employees, limit=200)
employees = Employee.search(dom_employees, limit=100)
print('Empleados ...', len(employees))
for employee in employees:
start = self.start.period.start
end = self.start.period.end
@ -817,8 +819,10 @@ class PayrollGroup(Wizard):
for wage_type in self.start.wage_types]
if payroll_to_create:
payrolls = Payroll.create(payroll_to_create)
print('payroll_to_create total', len(payrolls))
cont = 0
for payroll in payrolls:
print('contador > ', cont)
cont += 1
payroll.on_change_period()
payroll.set_preliquidation({}, None)