|
- Name
+ Name
|
- [[o.employee_id.name]]
+ [[o.employee_id.name]]
|
- Designation
+ Designation
|
[[ o.employee_id.job_id.name or '' ]]
@@ -250,7 +285,7 @@
|
- Email
+ Email
|
[[ o.employee_id.work_email or '' ]]
@@ -268,23 +303,23 @@
|
- Reference
+ Reference
|
[[ o.number or '' ]]
|
- Bank Account
+ Bank Account
|
- [[o.employee_id.bank_account_id and o.employee_id.bank_account_id.acc_number or '' ]]
+ [[ o.employee_id.otherid or '' ]]
|
|
- Date From
+ Date From
|
[[ o.date_from or '']]
@@ -299,27 +334,27 @@
|
-
+
-
+
|
- Payslip Lines:
+ Payslip Lines:
|
|
- Code
+ Code
|
- Name
+ Name
|
- Amount (in [[o.company_id and o.company_id.currency_id.symbol or '']])
+ Amount (in [[o.company_id and o.company_id.currency_id.symbol or '']])
|
@@ -334,68 +369,107 @@
[[ p.name ]]
|
- [[ p.total or '0.0']]
+ [[ p.total or '0.0']]
|
-
+
|
- Details By Salary Head:
+ Details by Salary Rule Category:
|
|
- Code
+ Code
|
- Salary Head
+ Salary Rule Category
+ |
+
+ Name
+ |
+
+ Amount(in [[o.company_id and o.company_id.currency_id.symbol or '']])
+ |
+
+
+
+
+
+
+ [[repeatIn(get_details_by_rule_category(o.line_ids),'h') ]]
+
+
+ |
+
+ [[ h['code'] ]]
+ [[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font')]]
+
+ |
+
+ [[ '..'*h['level'] ]][[ h['rule_category'] ]][[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font') ]]
+ |
+
+ [[ h['name'] ]][[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font')]]
+ |
+
+ [[ h['total'] ]] [[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_10'})) or removeParentNode('font') ]]
+ |
+
+
+
+
+
+
+
+
+ |
+ Payslip Lines by Contribution Register:
+ |
+
+
+
+
+ |
+ Register Name
+ |
+
+ Code
|
Name
|
- Amount(in [[o.company_id and o.company_id.currency_id.symbol or '']])
+ Amount (in [[o.company_id and o.company_id.currency_id.symbol or '']])
|
- [[repeatIn(get_details_by_salary_head(o.line_ids),'h') ]]
-
+ [[repeatIn(get_lines_by_contribution_register(o.line_ids),'r') ]]
+
|
-
- [[ h['code'] ]]
- [[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font') ]]
-
+ [[ r.get('register_name', False) ]][[ h.get('register_name', False) and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font')]]
|
- [[ '..'*h['level'] ]][[ h['salary_head'] ]][[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_9'})) or removeParentNode('font') ]]
+ [[ r['code'] ]]
|
- [[ h['name'] ]][[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_8'})) or removeParentNode('font') ]]
+ [[ r['name'] ]]
|
- [[ h['total'] ]][[ h['level']!=0 and ( setTag('para','para',{'style':'terp_default_10'})) or removeParentNode('font') ]]
+ [[ r['total'] or '0.0']]
|
-
-
-
-
-
-
-
-
-
|
@@ -404,7 +478,16 @@
|
- Authorized Signature
+
+
+
+
+
+
+
+
+
+ Authorized Signature
|
diff --git a/addons/hr_payroll/security/hr_security.xml b/addons/hr_payroll/security/hr_security.xml
index 339fb1961b9..d55f1c81cce 100644
--- a/addons/hr_payroll/security/hr_security.xml
+++ b/addons/hr_payroll/security/hr_security.xml
@@ -6,5 +6,12 @@
+
+ Employee Payslip
+
+ ['|', ('employee_id.user_id', '=', user.id), ('employee_id.department_id.manager_id.user_id', '=', user.id)]
+
+
+
\ No newline at end of file
diff --git a/addons/hr_payroll/security/ir.model.access.csv b/addons/hr_payroll/security/ir.model.access.csv
index 609fc99c034..d19ec411d5d 100644
--- a/addons/hr_payroll/security/ir.model.access.csv
+++ b/addons/hr_payroll/security/ir.model.access.csv
@@ -1,12 +1,15 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_payroll_structure","hr.payroll.structure","model_hr_payroll_structure","base.group_hr_user",1,1,1,1
"access_hr_contribution_register","hr.contribution.register","model_hr_contribution_register","base.group_hr_user",1,1,1,1
-"access_hr_salary_head","hr.salary.head","model_hr_salary_head","base.group_hr_user",1,1,1,1
+"access_hr_salary_rule_category","hr.salary.rule.category","model_hr_salary_rule_category","base.group_hr_user",1,1,1,1
"access_hr_payslip","hr.payslip","model_hr_payslip","base.group_hr_user",1,1,1,1
"access_hr_payslip_line","hr.payslip.line","model_hr_payslip_line","base.group_hr_user",1,1,1,1
-"access_res_partner_payroll","res.partner.payroll","base.model_res_partner","base.group_hr_user",1,1,1,1
+"access_hr_payslip_input_user","hr.payslip.input.user","model_hr_payslip_input","base.group_hr_user",1,1,1,1
"access_hr_payslip_manager","hr.payslip.manager","model_hr_payslip","base.group_hr_manager",1,1,1,1
"access_hr_payslip_line_manager","hr.payslip.line.manager","model_hr_payslip_line","base.group_hr_manager",1,1,1,1
"access_hr_payroll_structure_manager","hr.payroll.structure.manager","model_hr_payroll_structure","base.group_hr_manager",1,1,1,1
-"access_hr_payslip_input ","hr.payslip.input","model_hr_payslip_input","base.group_hr_manager",1,1,1,1
+"access_hr_payslip_worked_days ","hr.payslip.worked_days","model_hr_payslip_worked_days","base.group_hr_manager",1,1,1,1
"access_hr_salary_rule","hr.salary.rule","model_hr_salary_rule","base.group_hr_manager",1,1,1,1
+"access_hr_payslip_run","hr.payslip.run","model_hr_payslip_run","base.group_hr_manager",1,1,1,1
+"access_hr_payslip_input","hr.payslip.input","model_hr_payslip_input","base.group_hr_manager",1,1,1,1
+"access_hr_rule_input","hr.rule.input","model_hr_rule_input","base.group_hr_manager",1,1,1,1
diff --git a/addons/hr_payroll/wizard/__init__.py b/addons/hr_payroll/wizard/__init__.py
index 2cf78e17b1c..73a1b7ceb9e 100644
--- a/addons/hr_payroll/wizard/__init__.py
+++ b/addons/hr_payroll/wizard/__init__.py
@@ -1,7 +1,7 @@
#-*- coding:utf-8 -*-
##############################################################################
#
-# OpenERP, Open Source Management Solution
+# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
# d$
#
@@ -24,5 +24,6 @@
import hr_payroll_employees_detail
#import hr_payroll_create_analytic
import hr_payroll_year_salary
+import hr_payroll_payslips_by_employees
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py
new file mode 100644
index 00000000000..ebb9bed26c1
--- /dev/null
+++ b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.py
@@ -0,0 +1,63 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import time
+from datetime import datetime
+from dateutil import relativedelta
+
+from osv import fields, osv
+from tools.translate import _
+
+class hr_payslip_employees(osv.osv_memory):
+
+ _name ='hr.payslip.employees'
+ _description = 'Generate payslips for all selected employees'
+ _columns = {
+ 'employee_ids': fields.many2many('hr.employee', 'hr_employee_group_rel', 'payslip_id', 'employee_id', 'Employees'),
+ }
+
+ def compute_sheet(self, cr, uid, ids, context=None):
+ emp_pool = self.pool.get('hr.employee')
+ slip_pool = self.pool.get('hr.payslip')
+ slip_ids = []
+ if context is None:
+ context = {}
+ data = self.read(cr, uid, ids, context=context)[0]
+ if not data['employee_ids']:
+ raise osv.except_osv(_("Warning !"), _("You must select employee(s) to generate payslip(s)"))
+ for emp in emp_pool.browse(cr, uid, data['employee_ids'], context=context):
+ slip_data = slip_pool.onchange_employee_id(cr, uid, [], time.strftime('%Y-%m-01'), str(datetime.now() + relativedelta.relativedelta(months=+1, day=1, days=-1))[:10], emp.id, contract_id=False, context=context)
+ res = {
+ 'employee_id': emp.id,
+ 'name': slip_data['value'].get('name', False),
+ 'struct_id': slip_data['value'].get('struct_id', False),
+ 'contract_id': slip_data['value'].get('contract_id', False),
+ 'payslip_run_id': context.get('active_id', False),
+ 'input_line_ids': [(0, 0, x) for x in slip_data['value'].get('input_line_ids', False)],
+ 'worked_days_line_ids': [(0, 0, x) for x in slip_data['value'].get('worked_days_line_ids', False)]
+ }
+ slip_ids.append(slip_pool.create(cr, uid, res, context=context))
+ slip_pool.compute_sheet(cr, uid, slip_ids, context=context)
+ return {'type': 'ir.actions.act_window_close'}
+
+hr_payslip_employees()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.xml b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.xml
new file mode 100644
index 00000000000..c8bd142dbf9
--- /dev/null
+++ b/addons/hr_payroll/wizard/hr_payroll_payslips_by_employees.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ hr_payroll_payslip_employees
+ hr.payslip.employees
+ form
+
+
+
+
+
+
+ Generate Payslips
+ hr.payslip.employees
+ form
+ tree,form
+
+ new
+
+
+
+
|