diff --git a/addons/l10n_in_hr_payroll/__openerp__.py b/addons/l10n_in_hr_payroll/__openerp__.py index 2522d543548..c86ad06c387 100644 --- a/addons/l10n_in_hr_payroll/__openerp__.py +++ b/addons/l10n_in_hr_payroll/__openerp__.py @@ -49,6 +49,7 @@ Indian Payroll Salary Rules. 'security/ir.model.access.csv', 'l10n_in_hr_payroll_report.xml', 'l10n_in_hr_payroll_sequence.xml', + 'views/report_hrsalarybymonth.xml', 'wizard/hr_salary_employee_bymonth_view.xml', 'wizard/hr_yearly_salary_detail_view.xml', 'report/payment_advice_report_view.xml', diff --git a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml index 7f27291051f..dc07633ea3d 100644 --- a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml +++ b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll_report.xml @@ -18,13 +18,13 @@ rml="l10n_in_hr_payroll/report/report_payroll_advice.rml" string="Print Advice" /> - + 'None': + if month <> '': if len(month) != 7: month = '0' + str(month) if month in salary and salary[month]: @@ -102,7 +102,7 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse): def get_employee(self, form): emp_salary = [] salary_list = [] - total_mnths=['Total', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + total_mnths=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] emp_obj = self.pool.get('hr.employee') emp_ids = form.get('employee_ids', []) employees = emp_obj.browse(self.cr, self.uid, emp_ids, context=self.context) @@ -128,6 +128,10 @@ class report_hr_salary_employee_bymonth(report_sxw.rml_parse): self.total += item[count] return self.total -report_sxw.report_sxw('report.salary.employee.bymonth', 'hr.salary.employee.month', 'l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml', parser=report_hr_salary_employee_bymonth, header='internal') +class employee_salary_bymonth(osv.AbstractModel): + _name = 'report.l10n_in_hr_payroll.report_hrsalarybymonth' + _inherit = 'report.abstract_report' + _template = 'l10n_in_hr_payroll.report_hrsalarybymonth' + _wrapped_report_class = report_hr_salary_employee_bymonth # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml b/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml deleted file mode 100644 index 6368a644f4b..00000000000 --- a/addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.rml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Yearly Salary Details - From [[ formatLang(data['form']['start_date'], date=True) ]] To [[ formatLang(data['form']['end_date'], date=True) ]] of [[ (data['form']['category_id'][1]) ]] Category - - - -
- [[ repeatIn(get_periods(data['form']),'m') ]] - - - - Name - - - [[ m[0] != 'None' and m[0] or '' ]] - - - [[ m[1] != 'None' and m[1] or '' ]] - - - [[ m[2] != 'None' and m[2] or '' ]] - - - [[ m[3] != 'None' and m[3] or '' ]] - - - [[ m[4] != 'None' and m[4] or '' ]] - - - [[ m[5] != 'None' and m[5] or '' ]] - - - [[ m[6] != 'None' and m[6] or '' ]] - - - [[ m[7] != 'None' and m[7] or '' ]] - - - [[ m[8] != 'None' and m[8] or '' ]] - - - [[ m[9] != 'None' and m[9] or '' ]] - - - [[ m[10] != 'None' and m[10] or '' ]] - - - [[ m[11] != 'None' and m[11] or '' ]] - - - Total - - - -
- [[ repeatIn(get_employee(data['form']),'e') ]] - - - - [[ e[0] ]] - - - - [[ (e[1]!='' and formatLang(e[1])) or removeParentNode('font') ]] - - - - - [[ (e[2]!='' and formatLang(e[2])) or removeParentNode('font') ]] - - - - - [[ (e[3]!='' and formatLang(e[3])) or removeParentNode('font') ]] - - - - - [[ (e[4]!='' and formatLang(e[4])) or removeParentNode('font') ]] - - - - - [[ (e[5]!='' and formatLang(e[5])) or removeParentNode('font') ]] - - - - - [[ (e[6]!='' and formatLang(e[6])) or removeParentNode('font') ]] - - - - - [[ (e[7]!='' and formatLang(e[7])) or removeParentNode('font') ]] - - - - - [[ (e[8]!='' and formatLang(e[8])) or removeParentNode('font') ]] - - - - - [[ (e[9]!='' and formatLang(e[9])) or removeParentNode('font') ]] - - - - - [[ (e[10]!='' and formatLang(e[10])) or removeParentNode('font') ]] - - - - - [[ (e[11]!='' and formatLang(e[11])) or removeParentNode('font') ]] - - - - - [[ (e[12]!='' and formatLang(e[12])) or removeParentNode('font') ]] - - - - [[ formatLang(e[13],currency_obj= company.currency_id)]] - - - -
-
-
- [[ repeatIn(get_months_tol(),'t') ]] - - - - Total - - - [[ formatLang(t[1],currency_obj= company.currency_id) or removeParentNode('para') ]] - - - [[ formatLang(t[2],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[3],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[4],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[5],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[6],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[7],currency_obj= company.currency_id) or removeParentNode('para')]] ] - - - [[ formatLang(t[8],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[9],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[10],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[11],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(t[12],currency_obj= company.currency_id) or removeParentNode('para')]] - - - [[ formatLang(get_total(), currency_obj = company.currency_id)]] - - - -
-
-
diff --git a/addons/l10n_in_hr_payroll/views/report_hrsalarybymonth.xml b/addons/l10n_in_hr_payroll/views/report_hrsalarybymonth.xml new file mode 100644 index 00000000000..18a81412e26 --- /dev/null +++ b/addons/l10n_in_hr_payroll/views/report_hrsalarybymonth.xml @@ -0,0 +1,52 @@ + + + + + + \ No newline at end of file diff --git a/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py b/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py index 93594e1dff8..6e37f5b58d5 100644 --- a/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py +++ b/addons/l10n_in_hr_payroll/wizard/hr_salary_employee_bymonth.py @@ -20,7 +20,6 @@ ############################################################################## import time - from openerp.osv import fields, osv class hr_salary_employee_bymonth(osv.osv_memory): @@ -60,11 +59,8 @@ class hr_salary_employee_bymonth(osv.osv_memory): res = self.read(cr, uid, ids, context=context) res = res and res[0] or {} datas.update({'form': res}) - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'salary.employee.bymonth', - 'datas': datas, - } + return self.pool['report'].get_action(cr, uid, ids, + 'l10n_in_hr_payroll.report_hrsalarybymonth', + data=datas, context=context) - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: