diff --git a/addons/crm/wizard/crm_merge_opportunities_view.xml b/addons/crm/wizard/crm_merge_opportunities_view.xml index cf1a7ee09a4..153267f0ad1 100644 --- a/addons/crm/wizard/crm_merge_opportunities_view.xml +++ b/addons/crm/wizard/crm_merge_opportunities_view.xml @@ -35,9 +35,10 @@ - \ No newline at end of file + diff --git a/addons/hr/board_hr_view.xml b/addons/hr/board_hr_view.xml index c740114789a..2bcc7738397 100644 --- a/addons/hr/board_hr_view.xml +++ b/addons/hr/board_hr_view.xml @@ -2,10 +2,6 @@ - @@ -32,6 +28,11 @@ menu - + + diff --git a/addons/hr/hr.py b/addons/hr/hr.py index c05836c393a..240511a03a0 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -82,16 +82,23 @@ class hr_job(osv.osv): def _no_of_employee(self, cr, uid, ids, name, args, context=None): res = {} - for emp in self.browse(cr, uid, ids): - res[emp.id] = len(emp.employee_ids or []) + for job in self.browse(cr, uid, ids, context): + res[job.id] = len(job.employee_ids or []) + return res + + def _no_of_recruitement(self, cr, uid, ids, name, args, context=None): + res = {} + for job in self.browse(cr, uid, ids, context): + res[job.id] = job.expected_employees - job.no_of_employee return res _name = "hr.job" _description = "Job Description" _columns = { 'name': fields.char('Job Name', size=128, required=True, select=True), - 'expected_employees': fields.integer('Expected Employees', help='Required number of Employees'), - 'no_of_employee': fields.function(_no_of_employee, method=True, string='No of Employees', type='integer', help='Number of Employees selected'), + 'expected_employees': fields.integer('Expected Employees', help='Required number of Employees in total for that job.'), + 'no_of_employee': fields.function(_no_of_employee, method=True, string="No of Employee", help='Number of employee with that job.'), + 'no_of_recruitment': fields.function(_no_of_recruitement, method=True, string='Expected in Recruitment', readonly=True), 'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees'), 'description': fields.text('Job Description'), 'requirements': fields.text('Requirements'), @@ -102,9 +109,17 @@ class hr_job(osv.osv): _defaults = { 'expected_employees': 1, 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr.job', context=c), - 'state': 'open' + 'state': 'open', } + def on_change_expected_employee(self, cr, uid, ids, expected_employee, no_of_employee, context=None): + if context is None: + context = {} + result={} + if expected_employee: + result['no_of_recruitment'] = expected_employee - no_of_employee + return {'value': result} + def job_old(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'old'}) return True diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 2b1cd596024..ce501c6951a 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -324,8 +324,9 @@ - + + @@ -360,6 +361,7 @@ + diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py index 3714050cbdb..8a52d0e2577 100644 --- a/addons/hr_attendance/__openerp__.py +++ b/addons/hr_attendance/__openerp__.py @@ -32,7 +32,6 @@ 'author': 'OpenERP SA', 'depends': ['hr'], 'update_xml': [ - 'security/hr_security.xml', 'security/ir.model.access.csv', 'hr_attendance_view.xml', 'hr_attendance_report.xml', diff --git a/addons/hr_attendance/security/hr_security.xml b/addons/hr_attendance/security/hr_security.xml deleted file mode 100644 index 39f923a895b..00000000000 --- a/addons/hr_attendance/security/hr_security.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/addons/hr_contract/__openerp__.py b/addons/hr_contract/__openerp__.py index 2851a9aa86b..aea686e4279 100755 --- a/addons/hr_contract/__openerp__.py +++ b/addons/hr_contract/__openerp__.py @@ -36,7 +36,6 @@ 'depends': ['hr'], 'init_xml': ['hr_contract_data.xml'], 'update_xml': [ - 'security/hr_contract_security.xml', 'security/ir.model.access.csv', 'hr_contract_view.xml' ], diff --git a/addons/hr_contract/security/hr_contract_security.xml b/addons/hr_contract/security/hr_contract_security.xml deleted file mode 100644 index 39f923a895b..00000000000 --- a/addons/hr_contract/security/hr_contract_security.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 960849bdfd4..97f00d8b861 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -267,7 +267,18 @@ class hr_evaluation(osv.osv): context = {} self.write(cr, uid, ids,{'state':'cancel'}, context=context) return True - + + def write(self, cr, uid, ids, vals, context=None): + if context is None: + context = {} + if 'date' in vals: + new_vals = {'date_deadline': vals.get('date')} + obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview') + for evalutation in self.browse(cr, uid, ids, context=context): + for survey_req in evalutation.survey_request_ids: + obj_hr_eval_iterview.write(cr, uid, [survey_req.id], new_vals, context=context) + return super(hr_evaluation, self).write(cr, uid, ids, vals, context=context) + hr_evaluation() class survey_request(osv.osv): @@ -320,7 +331,7 @@ class hr_evaluation_interview(osv.osv): for id in self.browse(cr, uid, ids, context=context): flag = False wating_id = 0 - tot_done_req = 0 + tot_done_req = 1 if not id.evaluation_id.id: raise osv.except_osv(_('Warning !'),_("You cannot start evaluation without Evaluation.")) records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids diff --git a/addons/hr_evaluation/wizard/hr_evaluation_mail.py b/addons/hr_evaluation/wizard/hr_evaluation_mail.py index 576c782bfd8..3464c4beaee 100644 --- a/addons/hr_evaluation/wizard/hr_evaluation_mail.py +++ b/addons/hr_evaluation/wizard/hr_evaluation_mail.py @@ -29,14 +29,14 @@ class hr_evaluation_reminder(osv.osv_memory): } def send_mail(self, cr, uid, ids, context=None): - hr_evaluation_obj = self.pool.get('hr_evaluation.evaluation') + hr_evaluation_interview_obj = self.pool.get('hr.evaluation.interview') if context is None: context = {} evaluation_data = self.read(cr, uid, ids, context=context)[0] - for waiting_id in hr_evaluation_obj.browse(cr, uid, evaluation_data['evaluation_id'], context=context).survey_request_ids: - if waiting_id.state == "waiting_answer" and waiting_id.user_to_review_id.work_email : - msg = " Hello %s, \n\n Kindly post your response for %s survey. \n\n Thanks," %(waiting_id.user_to_review_id.name, waiting_id.survey_id.title) - tools.email_send(tools.config['email_from'], [waiting_id.user_to_review_id.work_email],\ + current_interview = hr_evaluation_interview_obj.browse(cr, uid, evaluation_data.get('evaluation_id')) + if current_interview.state == "waiting_answer" and current_interview.user_to_review_id.work_email : + msg = " Hello %s, \n\n Kindly post your response for '%s' survey interview. \n\n Thanks," %(current_interview.user_to_review_id.name, current_interview.survey_id.title) + tools.email_send(tools.config['email_from'], [current_interview.user_to_review_id.work_email],\ 'Reminder to fill up Survey', msg) return {'type': 'ir.actions.act_window_close'} diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml index 70b8625d7b6..0d94204f426 100644 --- a/addons/hr_expense/report/hr_expense_report_view.xml +++ b/addons/hr_expense/report/hr_expense_report_view.xml @@ -95,7 +95,7 @@ - + diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index b5380c4e5a9..0d78af87975 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -137,7 +137,7 @@ - +