diff --git a/addons/account/installer.py b/addons/account/installer.py index 961b8f9e763..343e22a7632 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -47,7 +47,7 @@ class account_installer(osv.osv_memory): # try get the list on apps server try: - apps_server = self.pool.get('ir.config_parameter').get_param(cr, uid, 'apps.server', 'https://apps.openerp.com') + apps_server = self.pool.get('ir.module.module').get_apps_server(cr, uid, context=context) up = urlparse.urlparse(apps_server) url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie) diff --git a/addons/account/report/account_entries_report.py b/addons/account/report/account_entries_report.py index 6060d97c182..df2d92c9f12 100644 --- a/addons/account/report/account_entries_report.py +++ b/addons/account/report/account_entries_report.py @@ -94,7 +94,7 @@ class account_entries_report(osv.osv): return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order, context=context, count=count) - def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False): + def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False,lazy=True): if context is None: context = {} fiscalyear_obj = self.pool.get('account.fiscalyear') @@ -108,7 +108,7 @@ class account_entries_report(osv.osv): domain.append(['period_id','in',ids]) else: domain = domain - return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby) + return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby,lazy) def init(self, cr): tools.drop_view_if_exists(cr, 'account_entries_report') diff --git a/addons/account/static/src/js/account_move_reconciliation.js b/addons/account/static/src/js/account_move_reconciliation.js index cbc0abc4f4d..1040e9d9b5c 100644 --- a/addons/account/static/src/js/account_move_reconciliation.js +++ b/addons/account/static/src/js/account_move_reconciliation.js @@ -86,10 +86,10 @@ openerp.account = function (instance) { var self = this; var ids = this.get_selected_ids(); if (ids.length === 0) { - instance.web.dialog($("
").text(_t("You must choose at least one record.")), { + new instance.web.Dialog(this, { title: _t("Warning"), - modal: true - }); + size: 'medium', + }, $("
").text(_t("You must choose at least one record."))).open(); return false; } diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index f4e5d17a8e0..7041c3aafbf 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -328,7 +328,7 @@ class account_asset_asset(osv.osv): default = {} if context is None: context = {} - default.update({'depreciation_line_ids': [], 'state': 'draft'}) + default.update({'depreciation_line_ids': [], 'account_move_line_ids': [], 'history_ids': [], 'state': 'draft'}) return super(account_asset_asset, self).copy(cr, uid, id, default, context=context) def _compute_entries(self, cr, uid, ids, period_id, context=None): diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index 2671fc92581..5a17ac91e53 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -26,6 +26,7 @@ import openerp.addons.decimal_precision as dp class analytic_user_funct_grid(osv.osv): _name="analytic.user.funct.grid" _description= "Price per User" + _rec_name="user_id" _columns={ 'user_id': fields.many2one("res.users", "User", required=True,), 'product_id': fields.many2one("product.product", "Service", required=True,), diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py index b4ce20d49e3..4fca426ffc0 100644 --- a/addons/auth_oauth/controllers/main.py +++ b/addons/auth_oauth/controllers/main.py @@ -2,6 +2,7 @@ import functools import logging import simplejson +import urlparse import werkzeug.utils from werkzeug.exceptions import BadRequest @@ -68,7 +69,8 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home): def get_state(self, provider): state = dict( d=request.session.db, - p=provider['id'] + p=provider['id'], + r=request.httprequest.full_path ) token = request.params.get('token') if token: @@ -137,8 +139,12 @@ class OAuthController(http.Controller): cr.commit() action = state.get('a') menu = state.get('m') + redirect = state.get('r') url = '/web' - if action: + if redirect and not redirect.startswith('/auth_oauth/signin') and \ + (not redirect.startswith('/web/login') or 'redirect' in urlparse.urlsplit(redirect).query): + url = redirect + elif action: url = '/web#action=%s' % action elif menu: url = '/web#menu_id=%s' % menu diff --git a/addons/auth_signup/auth_signup_data.xml b/addons/auth_signup/auth_signup_data.xml index f470811d39e..2789fcd8315 100644 --- a/addons/auth_signup/auth_signup_data.xml +++ b/addons/auth_signup/auth_signup_data.xml @@ -10,7 +10,7 @@ - + _usertemplate diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index 65737ad234e..cf756e121da 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -88,15 +88,12 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ var qdict = { current_layout : this.$el.find('.oe_dashboard').attr('data-layout') }; - var $dialog = instance.web.dialog($('
'), { - modal: true, + var $dialog = instance.web.Dialog(this, { title: _t("Edit Layout"), - width: 'auto', - height: 'auto' - }).html(QWeb.render('DashBoard.layouts', qdict)); + }, QWeb.render('DashBoard.layouts', qdict)).open(); $dialog.find('li').click(function() { var layout = $(this).attr('data-layout'); - $dialog.dialog('destroy'); + $dialog.modal('hide'); self.do_change_layout(layout); }); }, diff --git a/addons/calendar/__openerp__.py b/addons/calendar/__openerp__.py index 2f06a0b5cb9..f0417db1bf6 100644 --- a/addons/calendar/__openerp__.py +++ b/addons/calendar/__openerp__.py @@ -40,7 +40,6 @@ If you need to manage your meetings, you should install the CRM module. 'website': 'http://www.openerp.com', 'demo': ['calendar_demo.xml'], 'data': [ - 'security/calendar_security.xml', 'security/ir.model.access.csv', 'calendar_view.xml', 'contacts_view.xml', diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index e928432821b..add0030d76c 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1476,7 +1476,7 @@ class calendar_event(osv.Model): self.create_attendees(cr, uid, [res], context=context) return res - def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False): + def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True): if not context: context = {} @@ -1484,7 +1484,7 @@ class calendar_event(osv.Model): raise osv.except_osv(_('Warning!'), _('Group by date is not supported, use the calendar view instead.')) virtual_id = context.get('virtual_id', True) context.update({'virtual_id': False}) - res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby) + res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy=lazy) for result in res: #remove the count, since the value is not consistent with the result of the search when expand the group for groupname in groupby: diff --git a/addons/calendar/security/calendar_security.xml b/addons/calendar/security/calendar_security.xml deleted file mode 100644 index 7c4363d21fc..00000000000 --- a/addons/calendar/security/calendar_security.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - Survey / User - - - - diff --git a/addons/calendar/security/ir.model.access.csv b/addons/calendar/security/ir.model.access.csv index caa7f0c6970..4da2e1a1cc6 100644 --- a/addons/calendar/security/ir.model.access.csv +++ b/addons/calendar/security/ir.model.access.csv @@ -1,7 +1,6 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_calendar_attendee,calendar.attendee,model_calendar_attendee,,1,1,1,1 access_calendar_alarm,calendar.alarm,model_calendar_alarm,base.group_user,1,1,1,1 -access_calendar_attendee_survey_user,calendar.attendee,model_calendar_attendee,base.group_survey_user,1,0,0,0 access_calendar_event_manager,calendar.event.manager,model_calendar_event,base.group_sale_manager,1,1,1,1 access_calendar_event,calendar.event,model_calendar_event,base.group_sale_salesman,1,1,1,0 access_calendar_event_all,calendar.event_all,model_calendar_event,base.group_user,1,1,1,1 diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 07a36ea3a6b..3669b5a1e6f 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -105,9 +105,9 @@ -
@@ -420,20 +420,20 @@ - + - - + + - + - - - - + + + + diff --git a/addons/event_sale/event_sale_view.xml b/addons/event_sale/event_sale_view.xml index 821a4c19b83..1f42108c993 100644 --- a/addons/event_sale/event_sale_view.xml +++ b/addons/event_sale/event_sale_view.xml @@ -17,6 +17,28 @@
+ + event.registration.ticket.search + event.registration + + + + + + + + + + event.registration.ticket.tree + event.registration + + + + + + + + product.template diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py index 711571a2e89..2d62465ecb5 100644 --- a/addons/hr_evaluation/__openerp__.py +++ b/addons/hr_evaluation/__openerp__.py @@ -20,22 +20,24 @@ ############################################################################## { - 'name' : 'Employee Appraisals', + 'name': 'Employee Appraisals', 'version': '0.1', 'author': 'OpenERP SA', 'category': 'Human Resources', 'sequence': 31, 'website': 'http://www.openerp.com', 'summary': 'Periodical Evaluations, Appraisals, Surveys', - 'images': ['images/hr_evaluation_analysis.jpeg','images/hr_evaluation.jpeg','images/hr_interview_requests.jpeg'], - 'depends': ['hr','calendar','survey'], + 'images': ['images/hr_evaluation_analysis.jpeg', + 'images/hr_evaluation.jpeg', + 'images/hr_interview_requests.jpeg'], + 'depends': ['hr', 'calendar', 'survey'], 'description': """ Periodical Employees evaluation and appraisals ============================================== -By using this application you can maintain the motivational process by doing periodical evaluations of your employees' performance. The regular assessment of human resources can benefit your people as well your organization. +By using this application you can maintain the motivational process by doing periodical evaluations of your employees' performance. The regular assessment of human resources can benefit your people as well your organization. -An evaluation plan can be assigned to each employee. These plans define the frequency and the way you manage your periodic personal evaluations. You will be able to define steps and attach interview forms to each step. +An evaluation plan can be assigned to each employee. These plans define the frequency and the way you manage your periodic personal evaluations. You will be able to define steps and attach interview forms to each step. Manages several types of evaluations: bottom-up, top-down, self-evaluations and the final evaluation by the manager. @@ -47,23 +49,22 @@ Key Features * Every evaluation filled by employees can be viewed in a PDF form. * Interview Requests are generated automatically by OpenERP according to employees evaluation plans. Each user receives automatic emails and requests to perform a periodical evaluation of their colleagues. """, - "demo": ["hr_evaluation_demo.xml"], "data": [ 'security/ir.model.access.csv', 'security/hr_evaluation_security.xml', 'hr_evaluation_view.xml', 'report/hr_evaluation_report_view.xml', 'board_hr_evaluation_view.xml', + 'survey_data_appraisal.xml', 'hr_evaluation_data.xml', 'hr_evaluation_installer.xml', ], - 'test': [ - 'test/test_hr_evaluation.yml', - 'test/hr_evalution_demo.yml', - ], + "demo": ["hr_evaluation_demo.xml"], + # 'test': [ + # 'test/test_hr_evaluation.yml', + # 'test/hr_evalution_demo.yml', + # ], 'auto_install': False, 'installable': True, 'application': True, } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 462154e9e4a..7d9f45f3585 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -19,15 +19,17 @@ # ############################################################################## -from datetime import datetime +from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from dateutil import parser import time from openerp.osv import fields, osv from openerp.tools.translate import _ +from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DF -class hr_evaluation_plan(osv.osv): + +class hr_evaluation_plan(osv.Model): _name = "hr_evaluation.plan" _description = "Appraisal Plan" _columns = { @@ -42,11 +44,11 @@ class hr_evaluation_plan(osv.osv): 'active': True, 'month_first': 6, 'month_next': 12, - 'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c), + 'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account.account', context=c), } -class hr_evaluation_plan_phase(osv.osv): +class hr_evaluation_plan_phase(osv.Model): _name = "hr_evaluation.plan.phase" _description = "Appraisal Plan Phase" _order = "sequence" @@ -54,13 +56,13 @@ class hr_evaluation_plan_phase(osv.osv): 'name': fields.char("Phase", size=64, required=True), 'sequence': fields.integer("Sequence"), 'company_id': fields.related('plan_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), - 'plan_id': fields.many2one('hr_evaluation.plan','Appraisal Plan', ondelete='cascade'), + 'plan_id': fields.many2one('hr_evaluation.plan', 'Appraisal Plan', ondelete='cascade'), 'action': fields.selection([ - ('top-down','Top-Down Appraisal Requests'), - ('bottom-up','Bottom-Up Appraisal Requests'), - ('self','Self Appraisal Requests'), - ('final','Final Interview')], 'Action', required=True), - 'survey_id': fields.many2one('survey','Appraisal Form',required=True), + ('top-down', 'Top-Down Appraisal Requests'), + ('bottom-up', 'Bottom-Up Appraisal Requests'), + ('self', 'Self Appraisal Requests'), + ('final', 'Final Interview')], 'Action', required=True), + 'survey_id': fields.many2one('survey.survey', 'Appraisal Form', required=True), 'send_answer_manager': fields.boolean('All Answers', help="Send all answers to the manager"), 'send_answer_employee': fields.boolean('All Answers', @@ -72,15 +74,14 @@ class hr_evaluation_plan_phase(osv.osv): 'wait': fields.boolean('Wait Previous Phases', help="Check this box if you want to wait that all preceding phases " + "are finished before launching this phase."), - 'mail_feature': fields.boolean('Send mail for this phase', help="Check this box if you want to send mail to employees"+ - " coming under this phase"), + 'mail_feature': fields.boolean('Send mail for this phase', help="Check this box if you want to send mail to employees coming under this phase"), 'mail_body': fields.text('Email'), - 'email_subject':fields.text('char') + 'email_subject': fields.text('Subject') } _defaults = { 'sequence': 1, 'email_subject': _('''Regarding '''), - 'mail_body': lambda *a:_(''' + 'mail_body': lambda *a: _(''' Date: %(date)s Dear %(employee_name)s, @@ -98,26 +99,24 @@ Thanks, } -class hr_employee(osv.osv): +class hr_employee(osv.Model): _name = "hr.employee" - _inherit="hr.employee" - + _inherit = "hr.employee" _columns = { 'evaluation_plan_id': fields.many2one('hr_evaluation.plan', 'Appraisal Plan'), 'evaluation_date': fields.date('Next Appraisal Date', help="The date of the next appraisal is computed by the appraisal plan's dates (first appraisal + periodicity)."), } - def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None): + + def run_employee_evaluation(self, cr, uid, automatic=False, use_new_cursor=False, context=None): # cronjob now = parser.parse(datetime.now().strftime('%Y-%m-%d')) obj_evaluation = self.pool.get('hr_evaluation.evaluation') - emp_ids =self.search(cr, uid, [ ('evaluation_plan_id','<>',False), ('evaluation_date','=', False)], context=context) + emp_ids = self.search(cr, uid, [('evaluation_plan_id', '<>', False), ('evaluation_date', '=', False)], context=context) for emp in self.browse(cr, uid, emp_ids, context=context): - first_date = (now+ relativedelta(months=emp.evaluation_plan_id.month_first)).strftime('%Y-%m-%d') + first_date = (now + relativedelta(months=emp.evaluation_plan_id.month_first)).strftime('%Y-%m-%d') self.write(cr, uid, [emp.id], {'evaluation_date': first_date}, context=context) - emp_ids =self.search(cr, uid, [ - ('evaluation_plan_id','<>',False), ('evaluation_date','<=', time.strftime("%Y-%m-%d")), - ], context=context) + emp_ids = self.search(cr, uid, [('evaluation_plan_id', '<>', False), ('evaluation_date', '<=', time.strftime("%Y-%m-%d"))], context=context) for emp in self.browse(cr, uid, emp_ids, context=context): next_date = (now + relativedelta(months=emp.evaluation_plan_id.month_next)).strftime('%Y-%m-%d') self.write(cr, uid, [emp.id], {'evaluation_date': next_date}, context=context) @@ -126,39 +125,35 @@ class hr_employee(osv.osv): return True - -class hr_evaluation(osv.osv): +class hr_evaluation(osv.Model): _name = "hr_evaluation.evaluation" _inherit = "mail.thread" _description = "Employee Appraisal" - _rec_name = 'employee_id' _columns = { 'date': fields.date("Appraisal Deadline", required=True, select=True), 'employee_id': fields.many2one('hr.employee', "Employee", required=True), 'note_summary': fields.text('Appraisal Summary'), - 'note_action': fields.text('Action Plan', - help="If the evaluation does not meet the expectations, you can propose"+ - "an action plan"), + 'note_action': fields.text('Action Plan', help="If the evaluation does not meet the expectations, you can propose an action plan"), 'rating': fields.selection([ - ('0','Significantly bellow expectations'), - ('1','Did not meet expectations'), - ('2','Meet expectations'), - ('3','Exceeds expectations'), - ('4','Significantly exceeds expectations'), + ('0', 'Significantly below expectations'), + ('1', 'Do not meet expectations'), + ('2', 'Meet expectations'), + ('3', 'Exceeds expectations'), + ('4', 'Significantly exceeds expectations'), ], "Appreciation", help="This is the appreciation on which the evaluation is summarized."), - 'survey_request_ids': fields.one2many('hr.evaluation.interview','evaluation_id','Appraisal Forms'), + 'survey_request_ids': fields.one2many('hr.evaluation.interview', 'evaluation_id', 'Appraisal Forms'), 'plan_id': fields.many2one('hr_evaluation.plan', 'Plan', required=True), 'state': fields.selection([ - ('draft','New'), - ('cancel','Cancelled'), - ('wait','Plan In Progress'), - ('progress','Waiting Appreciation'), - ('done','Done'), + ('draft', 'New'), + ('cancel', 'Cancelled'), + ('wait', 'Plan In Progress'), + ('progress', 'Waiting Appreciation'), + ('done', 'Done'), ], 'Status', required=True, readonly=True), 'date_close': fields.date('Ending Date', select=True), } _defaults = { - 'date': lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'), + 'date': lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months=+1)).strftime('%Y-%m-%d'), 'state': lambda *a: 'draft', } @@ -169,7 +164,8 @@ class hr_evaluation(osv.osv): res = [] for record in reads: name = record.plan_id.name - res.append((record['id'], name)) + employee = record.employee_id.name_related + res.append((record['id'], name + ' / ' + employee)) return res def onchange_employee_id(self, cr, uid, ids, employee_id, context=None): @@ -183,7 +179,6 @@ class hr_evaluation(osv.osv): return {'value': vals} def button_plan_in_progress(self, cr, uid, ids, context=None): - mail_message = self.pool.get('mail.message') hr_eval_inter_obj = self.pool.get('hr.evaluation.interview') if context is None: context = {} @@ -202,10 +197,9 @@ class hr_evaluation(osv.osv): int_id = hr_eval_inter_obj.create(cr, uid, { 'evaluation_id': evaluation.id, - 'survey_id': phase.survey_id.id, - 'date_deadline': (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'), + 'phase_id': phase.id, + 'deadline': (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months=+1)).strftime('%Y-%m-%d'), 'user_id': child.user_id.id, - 'user_to_review_id': evaluation.employee_id.id }, context=context) if phase.wait: wait = True @@ -214,7 +208,7 @@ class hr_evaluation(osv.osv): if (not wait) and phase.mail_feature: body = phase.mail_body % {'employee_name': child.name, 'user_signature': child.user_id.signature, - 'eval_name': phase.survey_id.title, 'date': time.strftime('%Y-%m-%d'), 'time': time } + 'eval_name': phase.survey_id.title, 'date': time.strftime('%Y-%m-%d'), 'time': time} sub = phase.email_subject if child.work_email: vals = {'state': 'outgoing', @@ -224,32 +218,32 @@ class hr_evaluation(osv.osv): 'email_from': evaluation.employee_id.work_email} self.pool.get('mail.mail').create(cr, uid, vals, context=context) - self.write(cr, uid, ids, {'state':'wait'}, context=context) + self.write(cr, uid, ids, {'state': 'wait'}, context=context) return True def button_final_validation(self, cr, uid, ids, context=None): request_obj = self.pool.get('hr.evaluation.interview') - self.write(cr, uid, ids, {'state':'progress'}, context=context) + self.write(cr, uid, ids, {'state': 'progress'}, context=context) for evaluation in self.browse(cr, uid, ids, context=context): if evaluation.employee_id and evaluation.employee_id.parent_id and evaluation.employee_id.parent_id.user_id: self.message_subscribe_users(cr, uid, [evaluation.id], user_ids=[evaluation.employee_id.parent_id.user_id.id], context=context) - if len(evaluation.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', evaluation.id),('state', 'in', ['done','cancel'])], context=context)): - raise osv.except_osv(_('Warning!'),_("You cannot change state, because some appraisal(s) are in waiting answer or draft state.")) + if len(evaluation.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', evaluation.id), ('state', 'in', ['done', 'cancel'])], context=context)): + raise osv.except_osv(_('Warning!'), _("You cannot change state, because some appraisal forms have not been completed.")) return True def button_done(self, cr, uid, ids, context=None): - self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context) + self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context) return True def button_cancel(self, cr, uid, ids, context=None): - interview_obj=self.pool.get('hr.evaluation.interview') + interview_obj = self.pool.get('hr.evaluation.interview') evaluation = self.browse(cr, uid, ids[0], context) interview_obj.survey_req_cancel(cr, uid, [r.id for r in evaluation.survey_request_ids]) - self.write(cr, uid, ids,{'state':'cancel'}, context=context) + self.write(cr, uid, ids, {'state': 'cancel'}, context=context) return True def button_draft(self, cr, uid, ids, context=None): - self.write(cr, uid, ids,{'state': 'draft'}, context=context) + self.write(cr, uid, ids, {'state': 'draft'}, context=context) return True def copy(self, cr, uid, id, default=None, context=None): @@ -260,65 +254,90 @@ class hr_evaluation(osv.osv): default = default.copy() default['survey_request_ids'] = [] return super(hr_evaluation, self).copy(cr, uid, id, default, context=context) - + def write(self, cr, uid, ids, vals, context=None): if vals.get('employee_id'): employee_id = self.pool.get('hr.employee').browse(cr, uid, vals.get('employee_id'), context=context) if employee_id.parent_id and employee_id.parent_id.user_id: vals['message_follower_ids'] = [(4, employee_id.parent_id.user_id.partner_id.id)] if 'date' in vals: - new_vals = {'date_deadline': vals.get('date')} + new_vals = {'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: + for evaluation in self.browse(cr, uid, ids, context=context): + for survey_req in evaluation.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) -class survey_request(osv.osv): - _inherit = "survey.request" - _columns = { - 'is_evaluation': fields.boolean('Is Appraisal?'), - } - - -class hr_evaluation_interview(osv.osv): +class hr_evaluation_interview(osv.Model): _name = 'hr.evaluation.interview' - _inherits = {'survey.request': 'request_id'} - _inherit = 'mail.thread' - _rec_name = 'request_id' + _inherit = 'mail.thread' + _rec_name = 'user_to_review_id' _description = 'Appraisal Interview' _columns = { - 'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True), - 'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'), - 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Appraisal Form'), + 'request_id': fields.many2one('survey.user_input', 'Survey Request', ondelete='cascade', readonly=True), + 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Appraisal Plan', required=True), + 'phase_id': fields.many2one('hr_evaluation.plan.phase', 'Appraisal Phase', required=True), + 'user_to_review_id': fields.related('evaluation_id', 'employee_id', type="many2one", relation="hr.employee", string="Employee to evaluate"), + 'user_id': fields.many2one('res.users', 'Interviewer'), + 'state': fields.selection([('draft', "Draft"), + ('waiting_answer', "In progress"), + ('done', "Done"), + ('cancel', "Cancelled")], + string="State", required=True), + 'survey_id': fields.related('phase_id', 'survey_id', string="Appraisal Form", type="many2one", relation="survey.survey"), + 'deadline': fields.related('request_id', 'deadline', type="datetime", string="Deadline"), } _defaults = { - 'is_evaluation': True, + 'state': 'draft' } + def create(self, cr, uid, vals, context=None): + phase_obj = self.pool.get('hr_evaluation.plan.phase') + survey_id = phase_obj.read(cr, uid, vals.get('phase_id'), fields=['survey_id'], context=context)['survey_id'][0] + + if vals.get('user_id'): + user_obj = self.pool.get('res.users') + partner_id = user_obj.read(cr, uid, vals.get('user_id'), fields=['partner_id'], context=context)['partner_id'][0] + else: + partner_id = None + + user_input_obj = self.pool.get('survey.user_input') + + if not vals.get('deadline'): + vals['deadline'] = (datetime.now() + timedelta(days=28)).strftime(DF) + + ret = user_input_obj.create(cr, uid, {'survey_id': survey_id, + 'deadline': vals.get('deadline'), + 'type': 'link', + 'partner_id': partner_id}, context=context) + vals['request_id'] = ret + return super(hr_evaluation_interview, self).create(cr, uid, vals, context=context) + def name_get(self, cr, uid, ids, context=None): if not ids: return [] reads = self.browse(cr, uid, ids, context=context) res = [] for record in reads: - name = record.request_id.survey_id.title + name = record.survey_id.title res.append((record['id'], name)) return res def survey_req_waiting_answer(self, cr, uid, ids, context=None): - self.write(cr, uid, ids, { 'state': 'waiting_answer'}, context=context) + request_obj = self.pool.get('survey.user_input') + for interview in self.browse(cr, uid, ids, context=context): + request_obj.action_survey_resent(cr, uid, [interview.id], context=context) + self.write(cr, uid, interview.id, {'state': 'waiting_answer'}, context=context) return True def survey_req_done(self, cr, uid, ids, context=None): - hr_eval_obj = self.pool.get('hr_evaluation.evaluation') for id in self.browse(cr, uid, ids, context=context): flag = False wating_id = 0 if not id.evaluation_id.id: - raise osv.except_osv(_('Warning!'),_("You cannot start evaluation without Appraisal.")) - records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids + raise osv.except_osv(_('Warning!'), _("You cannot start evaluation without Appraisal.")) + records = id.evaluation_id.survey_request_ids for child in records: if child.state == "draft": wating_id = child.id @@ -327,35 +346,29 @@ class hr_evaluation_interview(osv.osv): flag = True if not flag and wating_id: self.survey_req_waiting_answer(cr, uid, [wating_id], context=context) - self.write(cr, uid, ids, { 'state': 'done'}, context=context) - return True - - def survey_req_draft(self, cr, uid, ids, context=None): - self.write(cr, uid, ids, { 'state': 'draft'}, context=context) + self.write(cr, uid, ids, {'state': 'done'}, context=context) return True def survey_req_cancel(self, cr, uid, ids, context=None): - self.write(cr, uid, ids, { 'state': 'cancel'}, context=context) + self.write(cr, uid, ids, {'state': 'cancel'}, context=context) return True def action_print_survey(self, cr, uid, ids, context=None): - """ - If response is available then print this response otherwise print survey form(print template of the survey). + """ If response is available then print this response otherwise print survey form (print template of the survey) """ + context = context if context else {} + interview = self.browse(cr, uid, ids, context=context)[0] + survey_obj = self.pool.get('survey.survey') + response_obj = self.pool.get('survey.user_input') + response = response_obj.browse(cr, uid, interview.request_id.id, context=context) + context.update({'survey_token': response.token}) + return survey_obj.action_print_survey(cr, uid, [interview.survey_id.id], context=context) - @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 Survey IDs - @param context: A standard dictionary for contextual values - @return: Dictionary value for print survey form. - """ - if context is None: - context = {} - record = self.browse(cr, uid, ids, context=context) - record = record and record[0] - context.update({'survey_id': record.survey_id.id, 'response_id': [record.response.id], 'response_no':0,}) - value = self.pool.get("survey").action_print_survey(cr, uid, ids, context=context) - return value - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1 + def action_start_survey(self, cr, uid, ids, context=None): + context = context if context else {} + interview = self.browse(cr, uid, ids, context=context)[0] + survey_obj = self.pool.get('survey.survey') + response_obj = self.pool.get('survey.user_input') + # grab the token of the response and start surveying + response = response_obj.browse(cr, uid, interview.request_id.id, context=context) + context.update({'survey_token': response.token}) + return survey_obj.action_start_survey(cr, uid, [interview.survey_id.id], context=context) diff --git a/addons/hr_evaluation/hr_evaluation_data.xml b/addons/hr_evaluation/hr_evaluation_data.xml index 2afb5200091..38171b0f733 100644 --- a/addons/hr_evaluation/hr_evaluation_data.xml +++ b/addons/hr_evaluation/hr_evaluation_data.xml @@ -1,4 +1,4 @@ - + @@ -16,1146 +16,7 @@ Manage employee reviews: you can define an appraisal campaign with several steps, with specific evaluation surveys according to hierarchy levels. Evaluations filled by employees may be exported as pdf files.

]]>
- - Self Appraisal - 20 - - - - 5 - open - - - Employee Appraisal Form - - - - - Work Plan - - - - - Employee Performance In Key Areas - - - The appraiser should rate the employee’s major work accomplishments and performance according to the metric provided below : - 1 - Significantly exceeds standards and expectations required of the position - 2 - Exceeds standards and expectations - 3 - Meet standards and expectations - 4 - Did not meet standards and expectations - 5 - Significantly below standards and expectations - - - Professional Development And Performance Plan (optional) - - - Identify professional, performance, or project objectives you recommend for employee’s continued career development over the coming year. - - - Employee Comments - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Employee Information - - multiple_textboxes_diff_type - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Overall Purpose Of Employee Appraisal - - descriptive_text - The comment you entered is in an invalid format. - * To initiate a clear and open communication of performance expectations -* To assist employees in their professional growth, through the identification of strengths and opportunities for development - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - At the outset of the appraisal time period - - descriptive_text - The comment you entered is in an invalid format. - * It is the joint responsibility of the employee and the supervisor (appraiser) to establish a feasible work plan for the coming year, including major employee responsibilities and corresponding benchmarks against which results will be evaluated. -* Critical or key elements of performance and professional development needs (if any), should also be noted at this time - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - At the conclusion of the appraisal time period - - descriptive_text - The comment you entered is in an invalid format. - * The employee will be responsible for completing a draft of the Appraisal Form as a tool for self-appraisal and a starting point for the supervisor’s evaluation. The employee can add examples of achievements for each criterion. -Once the form had been filled, the employee send it to his supervisor. - -* It is the primary responsibility of the supervisor to gather the necessary input from the appropriate sources of feedback (internal and/or external customers, peers). In case of collaboration with OpenERP SA Belgium, the supervisor must receive completed evaluation form from the employee's Belgian project manager. - -* The supervisor synthesizes and integrates all input into the completed appraisal. He motivates his evaluation in the ad hoc fields. - -* The employee may choose to offer comments or explanation regarding the completed review. - -* The supervisor send the form to the HR department in India and in Belgium. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Work Plan - - table - The comment you entered is in an invalid format. - - - - Other - - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Additional comments : - - comment - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Subject - - matrix_of_choices_only_one_ans - Recommendations / Appraisals - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Supervisors only : - - matrix_of_choices_only_one_ans - Recommendations / Appraisals - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Overall Performance Summary Rating - - descriptive_text - The comment you entered is in an invalid format. - including the project evaluation form (if any) - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Professional Development Objectives - - comment - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Personal Performance Objectives - - comment - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Project Objectives - - comment - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Use the following space to make any comments regarding the above performance evaluation. - - comment - The comment you entered is in an invalid format. - - - - Other - - - - - Name - - char - - - - Position Title - - char - - - - Appraisal for Period - - char - - - - Date of Review - - datetime - - - - Appraiser - - char - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - Ability to cope with multidisciplinary of team - - - - - 1 - Enthusiasm & implication toward projects/assignments - - - - - 1 - Compliance to internal rules and processes (timesheets completion, etc.) - - - - - 1 - Team spirit : ability to work efficiently with peers, manage the conflicts with diplomacy - - - - - 1 - Initiative and self autonomy - - - - - 1 - Ability to follow and complete work as instructed - - - - - 1 - Decision making - - - - - 1 - Customer commitment - - - - - 1 - Communication skills ( written & verbally): clearness, concision, exactitude - - - - - 1 - Technical skills regarding to the job requirements - - - - - 1 - Analytical and synthetic mind - - - - - 1 - Promptness and attendance record - - - - - 1 - Adaptability : Ability to adapt oneself to organizational changes while keeping efficiency - - - - - 1 - Creativity and forward looking aptitude - - - - - 1 - Time management : projects/tasks are completed on time - - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - Results of the bottom-up survey and mitigation actions to face technical, organizational, structural and/or relational issues - - - - - 1 - Delegation : Ability to efficiently assign tasks to other people - - - - - 1 - Leadership: create a challenging and motivating work environment aligned with the company's strategy - - - - - 1 - Leadership: sustain subordinates in their professional growth - - - - - 1 - Ability to manage planning resources, risks, budgets and deadlines - - - - - 1 - 1 - Objectives - - - - 1 - 1 - Results - - - - 1 - 1 - Comments - - - - 1 - At the conclusion of the appraisal time period: - - - - - 1 - At the outset of the appraisal time period: - - - - - - Employee Opinion - 20 - - - - 5 - - - Process - - - - - Survey - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Employee Details - - multiple_textboxes_diff_type - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Engagement - - matrix_of_choices_only_one_ans - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Leadership - - matrix_of_choices_only_one_ans - - - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Effectiveness - - matrix_of_choices_only_one_ans - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Continuous Improvement - - matrix_of_choices_only_one_ans - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Openness - - matrix_of_choices_only_one_ans - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Miscellaneous - - matrix_of_choices_only_one_ans - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - Additional comments : - - comment - The comment you entered is in an invalid format. - - - - Other - - - - - 1 - do_not_validate - do_not_validate - Please enter a comment. - The choices need to add up to [enter sum here]. - - The comment you entered is in an invalid format. - - This question requires an answer. - - At the supervisor's appraisal date - - descriptive_text - The comment you entered is in an invalid format. - * His direct reports will be invited through OpenERP to express a feedback on their supervisor's leadership and to give their opinion about their own engagement and effectiveness, the continuous improvement and openness in action in the company, ... - -* The employees will send back their anonymous answers to OpenERP. The data will be handled by the HR manager and a brief summary of the data will be sent to the concerned supervisor, to his team and to the supervisor's supervisor. -* The appraiser should rate the employee’s major work accomplishments and performance according to the metric provided below : - - 1 - Significantly exceeds standards and expectations required of the position - 2 - Exceeds standards and expectations - 3 - Meet standards and expectations - 4 - Did not meet standards and expectations - 5 - Significantly below standards and expectations - - - - Other - - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - 1 - 1 - - - - 1 - 1 - 2 - - - - 1 - 1 - 3 - - - - 1 - 1 - 4 - - - - 1 - 1 - 5 - - - - 1 - Demonstrates genuine concern for me as a person. - - - - - 1 - I'm efficient at work and my achievements are successful. - - - - - 1 - I am proud to tell others I work here. - - - - - 0 - Name of your direct supervisor - - char - - - - 1 - Actions by Executive management show genuine interest in the well-being of employees. - - - - - 1 - I know the company's values and live them. - - - - - 1 - My work contributes towards the continuous improvement of the company, our services or products. - - - - - 1 - I have enough work. - - - - - 0 - Date - - datetime - - - - 1 - I consistently acquire new knowledge, skills or understanding through contact with my supervisor. He helps me growing my compete - - - - - 1 - My job provides me with a sense of personal accomplishment. - - - - - 1 - What I did several months ago is still of use to the company, the services or the products today. - - - - - 1 - My best achievements have been communicated to the community, internally or to customers. - - - - - 1 - I have the same opportunity to succeed as others with similar experiences, performance and educational background. - - - - - 1 - Compared to similar jobs in other companies where I could work, my total compensation is: -(Scale: Well below others, Below othe - - - - - 1 - Overall, I believe the quality of products and/or services my workgroup delivers is improving. - - - - - 1 - I would prefer to remain with this company even if a comparable job were available in another company. - - - - - 1 - Listens and takes into account all ideas and do his best to put in place the best of these. - - - - - 1 - I mostly work on value-added tasks for the company, the products or the services. (Value-added task : significant improvement pe - - - - - 1 - Our workgroup identifies and reduces waste of time in our activities and processes. - - - - - 1 - Taking everything into account, how satisfied are you with your current job? - - - - - 1 - I understand the company strategy and how my workgroup supports it. - - - - - 1 - I am willing to put in a great deal of effort beyond what is expected to help my workgroup succeed. - - - - - 1 - I believe the information that I get from the person I report to. - - - - - - @@ -1163,9 +24,8 @@ Once the form had been filled, the employee send it to his supervisor. - - + Send to Employee @@ -1175,19 +35,17 @@ Once the form had been filled, the employee send it to his supervisor. self - + - - + - - + Run Employee Appraisal diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 28bc4a6c96e..8f3998eeb42 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -21,24 +21,26 @@ hr_evaluation.plan
- - - - - + + + + + + + + + + + - - - - - - - + + - - + + + -
+
hr_evaluation.plan.form @@ -58,9 +60,9 @@ form tree,form - + - + hr.evaluation.interview form @@ -127,7 +129,7 @@ - + @@ -165,11 +167,9 @@
- - - + + + - - - + + + + + + @@ -326,18 +299,18 @@ - + hr_evaluation.interview.tree hr.evaluation.interview - - + + - -
@@ -106,7 +106,7 @@ - @@ -345,7 +345,7 @@