diff --git a/addons/hr_holidays/hr_holidays_data.xml b/addons/hr_holidays/hr_holidays_data.xml
index 96fb29deae2..4e3a79f18f1 100644
--- a/addons/hr_holidays/hr_holidays_data.xml
+++ b/addons/hr_holidays/hr_holidays_data.xml
@@ -5,6 +5,7 @@
Casual Leave
+ Trueblack
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 49c1d5d249e..d250f69e904 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -93,11 +93,11 @@
-
+
-
+
@@ -135,11 +135,11 @@
-
+
-
+
diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py
index 320d0c47b6d..5b6eff0ad06 100644
--- a/addons/hr_recruitment/__openerp__.py
+++ b/addons/hr_recruitment/__openerp__.py
@@ -36,6 +36,7 @@ system to store and search in your CV base.
'depends': ['decimal_precision', 'hr', 'survey', 'crm'],
'update_xml': [
'wizard/hr_recruitment_phonecall_view.xml',
+ 'wizard/hr_recruitment_employee_hired.xml',
'wizard/hr_recruitment_create_partner_job_view.xml',
'hr_recruitment_view.xml',
'hr_recruitment_menu.xml',
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 02643a3e90e..6645a6f45c1 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -411,12 +411,29 @@ class hr_applicant(crm.crm_case, osv.osv):
for (id, name) in self.name_get(cr, uid, ids):
message = _("Applicant '%s' is being hired.") % name
self.log(cr, uid, id, message)
-
applicant = self.browse(cr, uid, ids)[0]
- if applicant.job_id:
- emp_id = employee_obj.create(cr,uid,{'name': applicant.name,'job_id': applicant.job_id.id})
+ if not applicant.job_id:
+ raise osv.except_osv(_('Warning!'),_('You must define job Id for Applicant !'))
+ emp_id = employee_obj.create(cr,uid,{'name': applicant.name,'job_id': applicant.job_id.id})
return res
+ def case_close_without_emp(self, cr, uid, ids, *args):
+ """
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of case's Ids
+ @param *args: Give Tuple Value
+ """
+ employee_obj = self.pool.get('hr.employee')
+ job_obj = self.pool.get('hr.job')
+ res = super(hr_applicant, self).case_close(cr, uid, ids, *args)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _("Applicant '%s' is being hired.") % name
+ self.log(cr, uid, id, message)
+ return res
+
+
def case_reset(self, cr, uid, ids, *args):
"""Resets case as draft
@param self: The object pointer
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 3738a1d8be6..f26d0347e4c 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -77,7 +77,6 @@
-
@@ -133,7 +132,7 @@
-
+
diff --git a/addons/hr_recruitment/wizard/__init__.py b/addons/hr_recruitment/wizard/__init__.py
index c946ed7264f..acabd219857 100644
--- a/addons/hr_recruitment/wizard/__init__.py
+++ b/addons/hr_recruitment/wizard/__init__.py
@@ -22,6 +22,7 @@
import hr_recruitment_phonecall
import hr_recruitment_create_partner_job
+import hr_recruitment_employee_hired
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py b/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py
new file mode 100644
index 00000000000..bcb5a5c2507
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# 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 .
+#
+##############################################################################
+from osv import osv, fields
+from tools.translate import _
+
+class hired_employee(osv.osv_memory):
+ _name = 'hired.employee'
+ _description = 'Create Employee'
+
+ def case_close(self, cr, uid,ids, context=None):
+ """
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of case's Ids
+ @param *args: Give Tuple Value
+ """
+ if context is None:
+ context = {}
+
+ hr_app = self.pool.get('hr.applicant')
+ hr_app.case_close(cr, uid,context.get('active_ids',False))
+ return {}
+
+ def case_close_without_emp(self, cr, uid,ids, context=None):
+ """
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of case's Ids
+ """
+ if context is None:
+ context = {}
+
+ hr_app = self.pool.get('hr.applicant')
+ hr_app.case_close_without_emp(cr, uid,context.get('active_ids',False))
+
+ return {}
+
+hired_employee()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.xml b/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.xml
new file mode 100644
index 00000000000..b447782719a
--- /dev/null
+++ b/addons/hr_recruitment/wizard/hr_recruitment_employee_hired.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+ hr.recruitment.hired2employee.form
+ hired.employee
+ form
+
+
+
+
+
+ Create Employee
+ ir.actions.act_window
+ hired.employee
+ form
+ form
+ new
+
+
+
+
\ No newline at end of file