Merge lp:~openerp-dev/openobject-addons/7.0-opw-605859-pna into lp:openobject-addons/7.0

Proposed by Pinakin Nayi (OpenERP)
Status: Merged
Merged at revision: 9947
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-605859-pna
Merge into: lp:openobject-addons/7.0
Diff against target: 26 lines (+3/-2)
1 file modified
hr_payroll/hr_payroll.py (+3/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-605859-pna
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) (community) Approve
Naresh(OpenERP) Pending
Review via email: mp+213405@code.launchpad.net

Description of the change

Hello Sir,

I fixed issue Concerning, the hr_payroll module. When configuring payroll rules with python code.

Problem:
When creating a salary rule with python code.
If result_rate is filled for one rule, the value persists for all other rules computed with python code.

Thanks,
pna

To post a comment you must log in.
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Merged in 7.0

revno: 9947 [merge]
revision-id: <email address hidden>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py 2013-12-23 12:44:13 +0000
+++ hr_payroll/hr_payroll.py 2014-04-02 08:30:41 +0000
@@ -578,7 +578,7 @@
578 payslip_obj = Payslips(self.pool, cr, uid, payslip.employee_id.id, payslip)578 payslip_obj = Payslips(self.pool, cr, uid, payslip.employee_id.id, payslip)
579 rules_obj = BrowsableObject(self.pool, cr, uid, payslip.employee_id.id, rules)579 rules_obj = BrowsableObject(self.pool, cr, uid, payslip.employee_id.id, rules)
580580
581 localdict = {'categories': categories_obj, 'rules': rules_obj, 'payslip': payslip_obj, 'worked_days': worked_days_obj, 'inputs': input_obj}581 baselocaldict = {'categories': categories_obj, 'rules': rules_obj, 'payslip': payslip_obj, 'worked_days': worked_days_obj, 'inputs': input_obj}
582 #get the ids of the structures on the contracts and their parent id as well582 #get the ids of the structures on the contracts and their parent id as well
583 structure_ids = self.pool.get('hr.contract').get_all_structures(cr, uid, contract_ids, context=context)583 structure_ids = self.pool.get('hr.contract').get_all_structures(cr, uid, contract_ids, context=context)
584 #get the rules of the structure and thier children584 #get the rules of the structure and thier children
@@ -588,11 +588,12 @@
588588
589 for contract in self.pool.get('hr.contract').browse(cr, uid, contract_ids, context=context):589 for contract in self.pool.get('hr.contract').browse(cr, uid, contract_ids, context=context):
590 employee = contract.employee_id590 employee = contract.employee_id
591 localdict.update({'employee': employee, 'contract': contract})591 localdict = dict(baselocaldict, employee=employee, contract=contract)
592 for rule in obj_rule.browse(cr, uid, sorted_rule_ids, context=context):592 for rule in obj_rule.browse(cr, uid, sorted_rule_ids, context=context):
593 key = rule.code + '-' + str(contract.id)593 key = rule.code + '-' + str(contract.id)
594 localdict['result'] = None594 localdict['result'] = None
595 localdict['result_qty'] = 1.0595 localdict['result_qty'] = 1.0
596 localdict['result_rate'] = 100
596 #check if the rule can be applied597 #check if the rule can be applied
597 if obj_rule.satisfy_condition(cr, uid, rule.id, localdict, context=context) and rule.id not in blacklist:598 if obj_rule.satisfy_condition(cr, uid, rule.id, localdict, context=context) and rule.id not in blacklist:
598 #compute the amount of the rule599 #compute the amount of the rule