From a523e73c1ebf89722759f83f050ec8256ae79e3e Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Mon, 14 Mar 2011 12:53:17 +0530 Subject: [PATCH] [IMP] hr_payroll: Code improved bzr revid: mra@mra-laptop-20110314072317-rivtyc4yokwvsqtd --- addons/hr_payroll/hr_payroll.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index ebd4e1eea43..9221496f8e8 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -922,12 +922,10 @@ class hr_payslip(osv.osv): lines = [] rules = [] - if function: - for struct in sal_structure: - func = func_pool.read(cr, uid, struct, ['rule_ids'], context=context) - lines = salary_rule_pool.browse(cr, uid, func['rule_ids'], context=context) - for rl in lines: - rules.append(rl) + for struct in sal_structure: + lines = func_pool.browse(cr, uid, struct, context=context).rule_ids + for rl in lines: + rules.append(rl) ad = [] total = 0.0 @@ -1000,7 +998,7 @@ class hr_payslip(osv.osv): } if line.appears_on_payslip: if line.condition_range_min or line.condition_range_max: - if not((line.amount < line.condition_range_min) or (line.amount > line.condition_range_max)): + if not ((line.amount < line.condition_range_min) or (line.amount > line.condition_range_max)): update['value']['line_ids'].append(vals) else: update['value']['line_ids'].append(vals)