diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index 4cf8cd89ec5..83365d79f51 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -53,7 +53,7 @@ - + diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml index 41c6cea2f77..dad4d39b776 100644 --- a/addons/auction/auction_view.xml +++ b/addons/auction/auction_view.xml @@ -1540,7 +1540,7 @@ Object encoded report.unclassified.objects tree - + diff --git a/addons/auction/board_auction_view.xml b/addons/auction/board_auction_view.xml index ca4b30bd688..6693622d55c 100644 --- a/addons/auction/board_auction_view.xml +++ b/addons/auction/board_auction_view.xml @@ -58,7 +58,7 @@ menu - + - + + Check Action Rules 4 hours @@ -10,10 +11,7 @@ - - - - - + + diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml index 1a9c1946b3c..66f857c4e94 100644 --- a/addons/base_action_rule/base_action_rule_view.xml +++ b/addons/base_action_rule/base_action_rule_view.xml @@ -14,10 +14,11 @@ form
- - + + + - + diff --git a/addons/board/board_view.xml b/addons/board/board_view.xml index f34c0ce5917..62204969468 100644 --- a/addons/board/board_view.xml +++ b/addons/board/board_view.xml @@ -3,7 +3,7 @@ - diff --git a/addons/crm/board_crm_statistical_view.xml b/addons/crm/board_crm_statistical_view.xml index 01d0472c21e..01aa479479f 100644 --- a/addons/crm/board_crm_statistical_view.xml +++ b/addons/crm/board_crm_statistical_view.xml @@ -112,7 +112,7 @@ - + menu - + =(dt or time.strftime('%Y-%m-%d %H:%M:%S')))) def attendance_action_change(self, cr, uid, ids, type='action', context=None, dt=False, *args): + obj_attendance = self.pool.get('hr.attendance') + if context is None: + context = {} id = False warning_sign = 'sign' res = {} @@ -136,7 +147,7 @@ class hr_employee(osv.osv): if dt: res['name'] = dt - id = self.pool.get('hr.attendance').create(cr, uid, res, context=context) + id = obj_attendance.create(cr, uid, res, context=context) if type != 'action': return id diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek.py b/addons/hr_attendance/wizard/hr_attendance_byweek.py index 9ef48f29fff..175ebf8a228 100644 --- a/addons/hr_attendance/wizard/hr_attendance_byweek.py +++ b/addons/hr_attendance/wizard/hr_attendance_byweek.py @@ -35,6 +35,8 @@ class hr_attendance_byweek(osv.osv_memory): } def print_report(self, cr, uid, ids, context=None): + if context is None: + context = {} datas = { 'ids': [], 'model': 'hr.employee', diff --git a/addons/hr_attendance/wizard/hr_attendance_error.py b/addons/hr_attendance/wizard/hr_attendance_error.py index 62689705c17..449fc4ca5c2 100644 --- a/addons/hr_attendance/wizard/hr_attendance_error.py +++ b/addons/hr_attendance/wizard/hr_attendance_error.py @@ -42,14 +42,14 @@ class hr_attendance_error(osv.osv_memory): if context is None: context = {} emp_ids = [] - data_error = self.read(cr, uid, ids)[0] + data_error = self.read(cr, uid, ids, context=context)[0] date_from = data_error['init_date'] date_to = data_error['end_date'] cr.execute("select id from hr_attendance where employee_id IN %s and to_char(name,'YYYY-mm-dd')<=%s and to_char(name,'YYYY-mm-dd')>=%s and action IN %s order by name" ,(tuple(context['active_ids']), date_to, date_from, tuple(['sign_in','sign_out']))) attendance_ids = [x[0] for x in cr.fetchall()] if not attendance_ids: raise osv.except_osv(_('No Data Available'), _('No records found for your selection!')) - attendance_records = self.pool.get('hr.attendance').browse(cr, uid, attendance_ids) + attendance_records = self.pool.get('hr.attendance').browse(cr, uid, attendance_ids, context=context) for rec in attendance_records: if rec.employee_id.id not in emp_ids: diff --git a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py index 7ffd94dbca5..5ac041d7a42 100644 --- a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py +++ b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py @@ -53,11 +53,15 @@ class hr_si_so_ask(osv.osv_memory): } def sign_in(self, cr, uid, ids, context=None): - data = self.read(cr, uid, ids, [])[0] + if context is None: + context = {} + data = self.read(cr, uid, ids, [], context=context)[0] return self.pool.get('hr.sign.in.out').sign_in(cr, uid, data, context) def sign_out(self, cr, uid, ids, context=None): - data = self.read(cr, uid, ids, [])[0] + if context is None: + context = {} + data = self.read(cr, uid, ids, [], context=context)[0] return self.pool.get('hr.sign.in.out').sign_out(cr, uid, data, context) hr_si_so_ask() @@ -74,6 +78,8 @@ class hr_sign_in_out(osv.osv_memory): } def _get_empid(self, cr, uid, context=None): + if context is None: + context = {} emp_id = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context) if emp_id: employee = self.pool.get('hr.employee').browse(cr, uid, emp_id, context=context)[0] @@ -81,6 +87,8 @@ class hr_sign_in_out(osv.osv_memory): return {} def default_get(self, cr, uid, fields_list, context=None): + if context is None: + context = {} res = super(hr_sign_in_out, self).default_get(cr, uid, fields_list, context=context) res_emp = self._get_empid(cr, uid, context=context) res.update(res_emp) @@ -89,10 +97,12 @@ class hr_sign_in_out(osv.osv_memory): def si_check(self, cr, uid, ids, context=None): obj_model = self.pool.get('ir.model.data') att_obj = self.pool.get('hr.attendance') - data = self.read(cr, uid, ids, [])[0] + if context is None: + context = {} + data = self.read(cr, uid, ids, [], context=context)[0] emp_id = data['emp_id'] att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id)], limit=1, order='name desc') - last_att = att_obj.browse(cr, uid, att_id) + last_att = att_obj.browse(cr, uid, att_id, context=context) if last_att: last_att = last_att[0] cond = not last_att or last_att.action == 'sign_out' @@ -113,8 +123,10 @@ class hr_sign_in_out(osv.osv_memory): def so_check(self, cr, uid, ids, context=None): obj_model = self.pool.get('ir.model.data') - data = self.read(cr, uid, ids, [])[0] att_obj = self.pool.get('hr.attendance') + if context is None: + context = {} + data = self.read(cr, uid, ids, [], context=context)[0] emp_id = data['emp_id'] att_id = att_obj.search(cr, uid, [('employee_id', '=', emp_id),('action', '!=', 'action')], limit=1, order='name desc') last_att = att_obj.browse(cr, uid, att_id, context=context) @@ -137,8 +149,8 @@ class hr_sign_in_out(osv.osv_memory): if cond: return self.sign_out(cr, uid, data, context) else: - model_data_ids = self.pool.get('ir.model.data').search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_hr_attendance_si_ask')], context=context) - resource_id = self.pool.get('ir.model.data').read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] + model_data_ids = att_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_hr_attendance_si_ask')], context=context) + resource_id = att_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] return { 'name': _('Sign in / Sign out'), 'view_type': 'form', @@ -150,12 +162,14 @@ class hr_sign_in_out(osv.osv_memory): } def sign_in(self, cr, uid, data, context=None): + if context is None: + context = {} emp_id = data['emp_id'] if 'last_time' in data: if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'): raise osv.except_osv(_('UserError'), _('The sign-out date must be in the past')) self.pool.get('hr.attendance').create(cr, uid, {'name': data['last_time'], 'action': 'sign_out', - 'employee_id': emp_id}) + 'employee_id': emp_id}, context=context) try: success = self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_in') except: @@ -163,11 +177,13 @@ class hr_sign_in_out(osv.osv_memory): return {} # To do: Return Success message def sign_out(self, cr, uid, data, context=None): + if context is None: + context = {} emp_id = data['emp_id'] if 'last_time' in data: if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'): raise osv.except_osv(_('UserError'), _('The Sign-in date must be in the past')) - self.pool.get('hr.attendance').create(cr, uid, {'name':data['last_time'], 'action':'sign_in', 'employee_id':emp_id}) + self.pool.get('hr.attendance').create(cr, uid, {'name':data['last_time'], 'action':'sign_in', 'employee_id':emp_id}, context=context) try: success = self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_out') except: diff --git a/addons/hr_recruitment/__openerp__.py b/addons/hr_recruitment/__openerp__.py index 0d10ba0f248..7779a1db90d 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': ['hr','survey','crm'], 'update_xml': [ 'wizard/hr_recruitment_phonecall_view.xml', + 'wizard/hr_recruitment_create_partner_job_view.xml', 'hr_recruitment_view.xml', 'hr_recruitment_menu.xml', # 'report_hr_recruitment_view.xml', @@ -43,7 +44,6 @@ system to store and search in your CV base. 'security/ir.model.access.csv', 'board_hr_recruitment_statistical_view.xml', 'report/hr_recruitment_report_view.xml', - 'wizard/hr_recruitment_create_partner_job_view.xml', ], 'init_xml': [ 'hr_recruitment_data.xml' diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 178fdbffb09..4297f8eb6c5 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -59,6 +59,19 @@ class hr_recruitment_stage(osv.osv): } hr_recruitment_stage() +class hr_recruitment_degree(osv.osv): + """ Degree of HR Recruitment """ + _name = "hr.recruitment.degree" + _description = "Degree of Recruitment" + _columns = { + 'name': fields.char('Name', size=64, required=True, translate=True), + 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of degrees."), + } + _defaults = { + 'sequence': 1, + } +hr_recruitment_degree() + class hr_applicant(osv.osv, crm.crm_case): _name = "hr.applicant" _description = "Applicant" @@ -88,6 +101,8 @@ class hr_applicant(osv.osv, crm.crm_case): # Applicant Columns 'date_closed': fields.datetime('Closed', readonly=True), 'date': fields.datetime('Date'), + 'date_action': fields.date('Next Action Date'), + 'title_action': fields.char('Next Action', size=64), 'priority': fields.selection(AVAILABLE_PRIORITIES, 'Appreciation'), 'job_id': fields.many2one('hr.job', 'Applied Job'), 'salary_proposed': fields.float('Proposed Salary', help="Salary Proposed by the Organisation"), @@ -96,7 +111,7 @@ class hr_applicant(osv.osv, crm.crm_case): 'partner_name': fields.char("Applicant's Name", size=64), 'partner_phone': fields.char('Phone', size=32), 'partner_mobile': fields.char('Mobile', size=32), - 'type_id': fields.many2one('crm.case.resource.type', 'Degree', domain="[('object_id.model', '=', 'hr.applicant')]"), + 'type_id': fields.many2one('hr.recruitment.degree', 'Degree'), 'department_id':fields.many2one('hr.department', 'Department'), 'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True), 'survey' : fields.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'), @@ -237,7 +252,7 @@ class hr_applicant(osv.osv, crm.crm_case): def message_new(self, cr, uid, msg, context): """ Automatically calls when new email message arrives - + @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks @@ -249,7 +264,7 @@ class hr_applicant(osv.osv, crm.crm_case): body = msg.get('body') msg_from = msg.get('from') priority = msg.get('priority') - + vals = { 'name': subject, 'email_from': msg_from, @@ -259,15 +274,15 @@ class hr_applicant(osv.osv, crm.crm_case): } if msg.get('priority', False): vals['priority'] = priority - + res = mailgate_pool.get_partner(cr, uid, msg.get('from')) if res: vals.update(res) res = self.create(cr, uid, vals, context) - + message = _('A Job Request created') + " '" + subject + "' " + _("from Mailgate.") self.log(cr, uid, res, message) - + attachents = msg.get('attachments', []) for attactment in attachents or []: data_attach = { @@ -283,16 +298,16 @@ class hr_applicant(osv.osv, crm.crm_case): return res def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', 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 update mail’s IDs + @param ids: List of update mail’s IDs """ - + if isinstance(ids, (str, int, long)): ids = [ids] - + msg_from = msg['from'] vals.update({ 'description': msg['body'] @@ -312,7 +327,7 @@ class hr_applicant(osv.osv, crm.crm_case): if res and maps.get(res.group(1).lower(), False): key = maps.get(res.group(1).lower()) vls[key] = res.group(2).lower() - + vals.update(vls) res = self.write(cr, uid, ids, vals) return res @@ -328,7 +343,7 @@ class hr_applicant(osv.osv, crm.crm_case): @param **args: Return Dictionary of Keyword Value """ return True - + def case_open(self, cr, uid, ids, *args): """ @param self: The object pointer diff --git a/addons/hr_recruitment/hr_recruitment_data.xml b/addons/hr_recruitment/hr_recruitment_data.xml index 8a4ddb93428..aaa386356c5 100644 --- a/addons/hr_recruitment/hr_recruitment_data.xml +++ b/addons/hr_recruitment/hr_recruitment_data.xml @@ -17,17 +17,17 @@ - + Graduate - + 1 - + Licenced - + 2 - + > Bac +5 - + 3 diff --git a/addons/hr_recruitment/hr_recruitment_demo.xml b/addons/hr_recruitment/hr_recruitment_demo.xml index 3eba3bc17de..52603d7b8fa 100644 --- a/addons/hr_recruitment/hr_recruitment_demo.xml +++ b/addons/hr_recruitment/hr_recruitment_demo.xml @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -83,7 +83,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -121,7 +121,7 @@ - + diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml index 971423d45a7..ec6b719c973 100644 --- a/addons/hr_recruitment/hr_recruitment_menu.xml +++ b/addons/hr_recruitment/hr_recruitment_menu.xml @@ -7,9 +7,9 @@ Applicants hr.applicant - tree,form,graph + tree,form,graph,calendar - {"search_default_user_id":uid} + {"search_default_user_id":uid, 'search_default_current': 1} diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index b4b1a434700..6a622a09ddf 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -55,6 +55,8 @@