[FIX] hr_contract: Include archived employees on _get_all_contracts
Purpose ======= When we want to retrieve all the contract (running for instance), we don't care about the fact that the employee is archived or not. For example when we generate the work entries to generate the payslips, we actually pay the employee, even if he's archived (which is the normal flow). closes odoo/odoo#66836 X-original-commit: 262bf8598f9d885382c05e523543019767b521bf Related: odoo/enterprise#16677 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -66,7 +66,7 @@ class Employee(models.Model):
|
||||
"""
|
||||
Returns the contracts of all employees between date_from and date_to
|
||||
"""
|
||||
return self.search([])._get_contracts(date_from, date_to, states=states)
|
||||
return self.search(['|', ('active', '=', True), ('active', '=', False)])._get_contracts(date_from, date_to, states=states)
|
||||
|
||||
def write(self, vals):
|
||||
res = super(Employee, self).write(vals)
|
||||
|
||||
Reference in New Issue
Block a user