From 0b2aeb031e7584aefd6350195b9cdc308505bd32 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 1 Apr 2011 16:28:07 +0530 Subject: [PATCH] [FIX] Payroll: Small but if we have no stcture defined for contract and try to make onchanges bzr revid: mra@mra-laptop-20110401105807-1l1z3gvg1top1wei --- addons/hr_payroll/hr_payroll.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index c5c62527181..944a0041815 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -529,7 +529,7 @@ class hr_payslip(osv.osv): localdict = {'basic':value, 'employee':employee, 'contract':contract} exec contrib.python_compute in localdict value = localdict['result'] - return value + return value return 0.0 _columns = { @@ -657,7 +657,7 @@ class hr_payslip(osv.osv): register_line_pool.create(cr, uid, reg_line) self.write(cr, uid, ids, {'state':'confirm'}, context=context) return True - + def get_contract(self, cr, uid, employee, date, context=None): contract_obj = self.pool.get('hr.contract') contracts = contract_obj.search(cr, uid, [('employee_id', '=', employee.id),('date_start','<=', date),'|',('date_end', '=', False),('date_end','>=', date)], context=context) @@ -1322,7 +1322,7 @@ class hr_payslip(osv.osv): update['value'].update({ 'number': number, 'name': 'Salary Slip of %s for %s' % (employee_id.name, tools.ustr(ttyme.strftime('%B-%Y'))), - 'basic_amount': basic, +# 'basic_amount': basic, # no need to pass its related field... but for multi contract we need to check for the possibility ... 'basic_before_leaves': basic_before_leaves, 'total_pay': total_before_leaves + total, 'leaves': total, @@ -1516,7 +1516,7 @@ class hr_payroll_structure(osv.osv): _columns = { 'rule_ids':fields.many2many('hr.salary.rule', 'hr_structure_salary_rule_rel', 'struct_id', 'rule_id', 'Salary Rules'), } - + hr_payroll_structure() class hr_employee(osv.osv):