[FIX]l10n_in_hr_payroll:default category set

bzr revid: kbh@tinyerp.com-20120809110010-7v74el735iu6lhe3
This commit is contained in:
Khushboo Bhatt (Open ERP) 2012-08-09 16:30:10 +05:30
parent 9c87c50576
commit 25e8f30e2d
2 changed files with 6 additions and 5 deletions

View File

@ -69,17 +69,14 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse):
return [mnth_name]
def get_salary(self, form, emp_id, emp_salary, total_mnths):
categories = form.get('category_id', [])
category_ids = []
category_ids.append(categories[0])
categories = form.get('category_id', [])[0]
self.cr.execute("select to_char(date_to,'mm-yyyy') as to_date ,sum(pl.total) \
from hr_payslip_line as pl \
left join hr_payslip as p on pl.slip_id = p.id \
left join hr_employee as emp on emp.id = p.employee_id \
left join resource_resource as r on r.id = emp.resource_id \
where p.state = 'done' and p.employee_id = %s and pl.category_id = %s \
group by r.name, p.date_to,emp.id",(emp_id,tuple(category_ids),))
group by r.name, p.date_to,emp.id",(emp_id,categories,))
sal = self.cr.fetchall()
salary = dict(sal)
total = 0.0

View File

@ -34,9 +34,13 @@ class hr_salary_employee_bymonth(osv.osv_memory):
'category_id': fields.many2one('hr.salary.rule.category', 'Category', required=True),
}
def _get_default_category(self, cr, uid, context=None):
return self.pool.get('hr.salary.rule.category').search(cr, uid, [('code', '=', 'NET')], context=context)
_defaults = {
'start_date': lambda *a: time.strftime('%Y-01-01'),
'end_date': lambda *a: time.strftime('%Y-%m-%d'),
'category_id': _get_default_category
}
def print_report(self, cr, uid, ids, context=None):