[FIX] hr_payroll: skip missing structures in get_all_structures for hr.contracts (eg: if structure is deleted afterward) (opw #602411)
bzr revid: mat@openerp.com-20131223124413-k0st3i54zou2bga8
This commit is contained in:
commit
4c0c6bbc76
|
@ -145,8 +145,9 @@ class hr_contract(osv.osv):
|
||||||
@param contract_ids: list of contracts
|
@param contract_ids: list of contracts
|
||||||
@return: the structures linked to the given contracts, ordered by hierachy (parent=False first, then first level children and so on) and without duplicata
|
@return: the structures linked to the given contracts, ordered by hierachy (parent=False first, then first level children and so on) and without duplicata
|
||||||
"""
|
"""
|
||||||
all_structures = []
|
structure_ids = [contract.struct_id.id for contract in self.browse(cr, uid, contract_ids, context=context) if contract.struct_id]
|
||||||
structure_ids = [contract.struct_id.id for contract in self.browse(cr, uid, contract_ids, context=context)]
|
if not structure_ids:
|
||||||
|
return []
|
||||||
return list(set(self.pool.get('hr.payroll.structure')._get_parent_structure(cr, uid, structure_ids, context=context)))
|
return list(set(self.pool.get('hr.payroll.structure')._get_parent_structure(cr, uid, structure_ids, context=context)))
|
||||||
|
|
||||||
hr_contract()
|
hr_contract()
|
||||||
|
|
Loading…
Reference in New Issue