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
'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):