mirror of
https://bitbucket.org/presik/trytonpsk-staff_payroll.git
synced 2023-12-14 05:33:13 +01:00
Fix count
This commit is contained in:
parent
7cbe2297c3
commit
5d85d7cd6c
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue