From 5fb77bd6c5116529e619d650feafa52e0714f68b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 2 Apr 2014 10:29:54 +0200 Subject: [PATCH] [IMP] hr_payroll: ensure localdict is not shared between contracts bzr revid: mat@openerp.com-20140402082954-05zzk1k3ued4go5a --- addons/hr_payroll/hr_payroll.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index cc94ac4d5db..67fb89ebcf5 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -578,7 +578,7 @@ class hr_payslip(osv.osv): payslip_obj = Payslips(self.pool, cr, uid, payslip.employee_id.id, payslip) rules_obj = BrowsableObject(self.pool, cr, uid, payslip.employee_id.id, rules) - localdict = {'categories': categories_obj, 'rules': rules_obj, 'payslip': payslip_obj, 'worked_days': worked_days_obj, 'inputs': input_obj} + baselocaldict = {'categories': categories_obj, 'rules': rules_obj, 'payslip': payslip_obj, 'worked_days': worked_days_obj, 'inputs': input_obj} #get the ids of the structures on the contracts and their parent id as well structure_ids = self.pool.get('hr.contract').get_all_structures(cr, uid, contract_ids, context=context) #get the rules of the structure and thier children @@ -588,7 +588,7 @@ class hr_payslip(osv.osv): for contract in self.pool.get('hr.contract').browse(cr, uid, contract_ids, context=context): employee = contract.employee_id - localdict.update({'employee': employee, 'contract': contract}) + localdict = dict(baselocaldict, employee=employee, contract=contract) for rule in obj_rule.browse(cr, uid, sorted_rule_ids, context=context): key = rule.code + '-' + str(contract.id) localdict['result'] = None