From 5fdb6292b1d492a793b9ce75852cef30a49f8591 Mon Sep 17 00:00:00 2001 From: Sunil Sharma Date: Tue, 22 Apr 2014 18:07:57 +0530 Subject: [PATCH 1/7] [imp]:add qweb report and remove rml report bzr revid: ssh@tinyerp.com-20140422123757-6wskvlwyltlyjvp0 --- addons/l10n_in_hr_payroll/__openerp__.py | 1 + .../l10n_in_hr_payroll_report.xml | 5 +- .../report/report_hr_yearly_salary_detail.py | 11 +- .../report/report_hr_yearly_salary_detail.rml | 588 ------------------ .../view/report_hr_yearly_salary_detail.xml | 103 +++ .../wizard/hr_yearly_salary_detail.py | 9 +- 6 files changed, 117 insertions(+), 600 deletions(-) delete mode 100644 addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.rml create mode 100644 addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml diff --git a/addons/l10n_in_hr_payroll/__openerp__.py b/addons/l10n_in_hr_payroll/__openerp__.py index 2522d543548..231491dd15a 100644 --- a/addons/l10n_in_hr_payroll/__openerp__.py +++ b/addons/l10n_in_hr_payroll/__openerp__.py @@ -53,6 +53,7 @@ Indian Payroll Salary Rules. 'wizard/hr_yearly_salary_detail_view.xml', 'report/payment_advice_report_view.xml', 'report/payslip_report_view.xml', + 'view/report_hr_yearly_salary_detail.xml', ], 'test': [ 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..90760d4b12f 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 @@ -30,8 +30,9 @@ auto="False" id="yearly_salary" model="yearly.salary.detail" - name="salary.detail.byyear" - rml="l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.rml" + name="l10n_in_hr_payroll.report_hr_yearly_salary" + file="l10n_in_hr_payroll.report_hr_yearly_salary" + report_type="qweb-pdf" string="Yearly Salary by Employee" /> diff --git a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py index 220bcdb5552..e531a335e7c 100644 --- a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py +++ b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py @@ -22,6 +22,7 @@ import time import datetime from openerp.report import report_sxw +from openerp.osv import osv class employees_yearly_salary_report(report_sxw.rml_parse): @@ -64,8 +65,8 @@ class employees_yearly_salary_report(report_sxw.rml_parse): current_year = last_year current_month = current_month + 1 for c in range(0, (12-no_months)): - mnth_name.append('None') - self.mnths.append('None') + mnth_name.append('') + self.mnths.append('') return [mnth_name] def get_employee(self, form): @@ -159,6 +160,10 @@ class employees_yearly_salary_report(report_sxw.rml_parse): def get_total(self): return self.total -report_sxw.report_sxw('report.salary.detail.byyear', 'yearly.salary.detail', 'hr_payroll/report/report_hr_yearly_salary_detail.rml', parser=employees_yearly_salary_report, header='internal landscape') +class wrapped_report_payslip(osv.AbstractModel): + _name = 'report.l10n_in_hr_payroll.report_hr_yearly_salary' + _inherit = 'report.abstract_report' + _template = 'l10n_in_hr_payroll.report_hr_yearly_salary' + _wrapped_report_class = employees_yearly_salary_report # 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_yearly_salary_detail.rml b/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.rml deleted file mode 100644 index 502eaa7b0ff..00000000000 --- a/addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.rml +++ /dev/null @@ -1,588 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [[ repeatIn(get_employee(data['form']), 'o') ]] - - - - From [[ formatLang(data['form']['date_from'], date=True) ]] To [[ formatLang(data['form']['date_to'], date=True) ]] - - - - - - - - - - Employee Code - - - [[ o.identification_id ]] - - - Department - - - [[ o.department_id and o.department_id.name or '' ]] - - - Bank - - - [[ o.bank_account_id and o.bank_account_id.bank.name or '' ]] - - - - - - - Employee Name - - - [[ o.name ]] - - - Other No. - - - [[ o.otherid or '' ]] - - - Address - - - [[o.address_home_id and o.address_home_id.name or '' ]] - - - - - - - Designation - - - [[ o.job_id and o.job_id.name or '' ]] - - - Phone No. - - - [[ o.work_phone or '' ]] - - - E-mail Address - - - [[o.work_email or '' ]] - - - - - - -
- [[ repeatIn(get_periods(data['form']),'m') ]] - [[ get_employee_detail((data['form']),o) ]] - - - - Title - - - [[ 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 - - - - - - -
- - - - Allowances with Basic: - - - -
- [[ repeatIn(get_allow(),'e1') ]] - - - - [[ e1[0] in ["Basic","Gross"] and e1[0] ]] - [[ e1[0] not in ["Basic","Gross"] and e1[0] ]] - - - - [[ (e1[0] in ["Basic","Gross"] and e1[1]!='' and formatLang(e1[1])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[1]!='' and formatLang(e1[1])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[2]!='' and formatLang(e1[2])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[2]!='' and formatLang(e1[2])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[3]!='' and formatLang(e1[3])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[3]!='' and formatLang(e1[3])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[4]!='' and formatLang(e1[4])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[4]!='' and formatLang(e1[4])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[5]!='' and formatLang(e1[5])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[5]!='' and formatLang(e1[5])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[6]!='' and formatLang(e1[6])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[6]!='' and formatLang(e1[6])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[7]!='' and formatLang(e1[7])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[7]!='' and formatLang(e1[7])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[8]!='' and formatLang(e1[8])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[8]!='' and formatLang(e1[8])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[9]!='' and formatLang(e1[9])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[9]!='' and formatLang(e1[9])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[10]!='' and formatLang(e1[10])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[10]!='' and formatLang(e1[10])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[11]!='' and formatLang(e1[11])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[11]!='' and formatLang(e1[11])) or removeParentNode('font') ]] - - - - - [[ (e1[0] in ["Basic","Gross"] and e1[12]!='' and formatLang(e1[12])) or removeParentNode('font') ]] - [[ (e1[0] not in ["Basic","Gross"] and e1[12]!='' and formatLang(e1[12])) or removeParentNode('font') ]] - - - - [[ formatLang(e1[13],currency_obj= company.currency_id) ]] - - - -
- - - - Deductions: - - - -
- [[ repeatIn(get_deduct(),'e2') ]] - - - - [[ e2[0] in ["Net"] and e2[0] ]] - [[ e2[0] not in ["Net"] and e2[0] ]] - - - - [[ (e2[0] in ["Net"] and e2[1]!='' and formatLang(e2[1])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[1]!='' and formatLang(e2[1])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[2]!='' and formatLang(e2[2])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[2]!='' and formatLang(e2[2])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[3]!='' and formatLang(e2[3])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[3]!='' and formatLang(e2[3])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[4]!='' and formatLang(e2[4])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[4]!='' and formatLang(e2[4])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[5]!='' and formatLang(e2[5])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[5]!='' and formatLang(e2[5])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[6]!='' and formatLang(e2[6])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[6]!='' and formatLang(e2[6])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[7]!='' and formatLang(e2[7])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[7]!='' and formatLang(e2[7])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[8]!='' and formatLang(e2[8])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[8]!='' and formatLang(e2[8])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[9]!='' and formatLang(e2[9])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[9]!='' and formatLang(e2[9])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[10]!='' and formatLang(e2[10])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[10]!='' and formatLang(e2[10])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[11]!='' and formatLang(e2[11])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[11]!='' and formatLang(e2[11])) or removeParentNode('font') ]] - - - - - [[ (e2[0] in ["Net"] and e2[12]!='' and formatLang(e2[12])) or removeParentNode('font') ]] - [[ (e2[0] not in ["Net"] and e2[12]!='' and formatLang(e2[12])) or removeParentNode('font') ]] - - - - [[ formatLang(e2[13],currency_obj= company.currency_id) ]] - - - -
-
- - - -
- - - -
-
diff --git a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml new file mode 100644 index 00000000000..5430518e10d --- /dev/null +++ b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml @@ -0,0 +1,103 @@ + + + + + + diff --git a/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py b/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py index de3680f2dd3..ec36a80dd46 100644 --- a/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py +++ b/addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py @@ -54,12 +54,7 @@ class yearly_salary_detail(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.detail.byyear', - 'datas': datas, - } - + datas.update({'form':res}) + return self.pool['report'].get_action(cr, uid, ids, 'l10n_in_hr_payroll.report_hr_yearly_salary', data=datas, context=context) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 06ca6d2540add7e8534dea69aa62a4b5aa2a1747 Mon Sep 17 00:00:00 2001 From: Sunil Sharma Date: Wed, 23 Apr 2014 10:59:10 +0530 Subject: [PATCH 2/7] [imp]:improve code bzr revid: ssh@tinyerp.com-20140423052910-486im2lmzpqev14n --- .../view/report_hr_yearly_salary_detail.xml | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml index 5430518e10d..fc7a2fd4b9f 100644 --- a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml +++ b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml @@ -36,19 +36,43 @@ Employee Name - + + + + + Other No. - + + + + + Address - + + + + + Designation - + + + + + Phone No. - + + + + + E-mail Address - + + + + + From f15123df698df890916a880ac6b5e10e7e73a045 Mon Sep 17 00:00:00 2001 From: Sunil Sharma Date: Wed, 23 Apr 2014 15:23:39 +0530 Subject: [PATCH 3/7] [imp]:improve code firsr first call layout then foreach loop bzr revid: ssh@tinyerp.com-20140423095339-lkswkyqyhw1cm6oj --- .../view/report_hr_yearly_salary_detail.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml index fc7a2fd4b9f..8a82db03497 100644 --- a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml +++ b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml @@ -3,9 +3,9 @@ From 45e74261e4d8f961373c8d68514bc9e37e0f1d5d Mon Sep 17 00:00:00 2001 From: Sunil Sharma Date: Thu, 24 Apr 2014 10:17:56 +0530 Subject: [PATCH 4/7] [imp]:improve use a text-center class bzr revid: ssh@tinyerp.com-20140424044756-ls3g2mour8rmjtes --- .../view/report_hr_yearly_salary_detail.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml index 8a82db03497..bf64d028430 100644 --- a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml +++ b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml @@ -6,11 +6,11 @@
-
-
From +
+
From To -
+

From ad71e6b87c3d841f761a65014dfc469e6bd09e4f Mon Sep 17 00:00:00 2001 From: Sunil Sharma Date: Thu, 24 Apr 2014 14:14:02 +0530 Subject: [PATCH 5/7] [imp]:improve th tag to td tag bzr revid: ssh@tinyerp.com-20140424084402-gam7edp04qvyj7gu --- .../view/report_hr_yearly_salary_detail.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml index bf64d028430..13383817889 100644 --- a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml +++ b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml @@ -14,20 +14,20 @@
- + - + - +
Employee CodeEmployee Code DepartmentDepartment BankBank From e5c1bf06a2ac350adf42eecfb3505d5633a5c319 Mon Sep 17 00:00:00 2001 From: Sunil Sharma Date: Thu, 24 Apr 2014 16:20:05 +0530 Subject: [PATCH 6/7] [imp]:remove br or text-center class then improve h2 or p tag bzr revid: ssh@tinyerp.com-20140424105005-bcg7ynx571h25w3w --- .../view/report_hr_yearly_salary_detail.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml index 13383817889..cc827bd6555 100644 --- a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml +++ b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml @@ -6,12 +6,10 @@
-
-
From +

+

From - To -

-
+ To

From 1e81e20cca31baffc487c32cb0f677888f2c260c Mon Sep 17 00:00:00 2001 From: "Sunil Sharma (OpenERP)" Date: Thu, 24 Apr 2014 17:32:02 +0530 Subject: [PATCH 7/7] [IMP]: Change function condition. bzr revid: atp@tinyerp.com-20140424120202-jqbkr72y1a43dbpf --- .../view/report_hr_yearly_salary_detail.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml index cc827bd6555..ce148d5fbf9 100644 --- a/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml +++ b/addons/l10n_in_hr_payroll/view/report_hr_yearly_salary_detail.xml @@ -10,7 +10,7 @@

From To

-
Employee Code
+
-
Employee Code @@ -18,7 +18,6 @@ Department @@ -73,7 +72,7 @@
- + @@ -88,7 +87,6 @@ -
Total
Allowances with Basic: