mirror of
https://bitbucket.org/presik/trytonpsk-staff_payroll.git
synced 2023-12-14 05:33:13 +01:00
minor fix domain employee
This commit is contained in:
parent
1056b2d713
commit
7f3ea78849
1 changed files with 7 additions and 7 deletions
14
payroll.py
14
payroll.py
|
@ -782,15 +782,15 @@ class PayrollGroup(Wizard):
|
|||
('period', '=', self.start.period.id),
|
||||
])
|
||||
|
||||
employees_w_payroll = [p.employee.id for p in payrolls_period if p.employee.contract and p.employee.contract.id == p.contract.id]
|
||||
dom_employees = self.get_employees_dom(employees_w_payroll)
|
||||
contracts_w_payroll = [p.contract.id for p in payrolls_period]
|
||||
dom_employees = self.get_employees_dom(contracts_w_payroll)
|
||||
payroll_to_create = []
|
||||
|
||||
for employee in Employee.search(dom_employees):
|
||||
employees = Employee.search(dom_employees)
|
||||
for employee in employees:
|
||||
start = self.start.period.start
|
||||
end = self.start.period.end
|
||||
contract = Payroll.search_contract_on_period(employee, self.start.period)
|
||||
if not contract:
|
||||
if not contract or contract.id in contracts_w_payroll:
|
||||
continue
|
||||
|
||||
values = self.get_values(contract, start, end)
|
||||
|
@ -808,10 +808,10 @@ class PayrollGroup(Wizard):
|
|||
payroll._create_payroll_lines(wages, None, {})
|
||||
return 'end'
|
||||
|
||||
def get_employees_dom(self, employees_w_payroll):
|
||||
def get_employees_dom(self, contracts_w_payroll):
|
||||
dom_employees = [
|
||||
('active', '=', True),
|
||||
('id', 'not in', employees_w_payroll),
|
||||
('contract', 'not in', contracts_w_payroll),
|
||||
]
|
||||
return dom_employees
|
||||
|
||||
|
|
Loading…
Reference in a new issue