diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml index cdd14780256..93dba0e5249 100644 --- a/addons/account/account_wizard.xml +++ b/addons/account/account_wizard.xml @@ -78,8 +78,8 @@ - diff --git a/addons/account/wizard/account_aged_trial_balance_view.xml b/addons/account/wizard/account_aged_trial_balance_view.xml index 258de38b714..7984f69e86e 100644 --- a/addons/account/wizard/account_aged_trial_balance_view.xml +++ b/addons/account/wizard/account_aged_trial_balance_view.xml @@ -2,11 +2,6 @@ - - Aged Partner Balance account.aged.trial.balance diff --git a/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py new file mode 100644 index 00000000000..27c0a2c49bd --- /dev/null +++ b/addons/hr_recruitment/wizard/hr_recruitment_phonecall.py @@ -0,0 +1,116 @@ +# -*- 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 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import time + +from osv import osv, fields +from tools.translate import _ + +class job2phonecall(osv.osv_memory): + _name = 'hr.recruitment.job2phonecall' + _description = 'Schedule Phone Call' + _columns = { + 'user_id': fields.many2one('res.users', 'Assign To'), + 'deadline': fields.datetime('Planned Date'), + 'note': fields.text('Goals'), + 'category_id': fields.many2one('crm.case.categ', 'Category', required=True), + } + + def _date_user(self, cr, uid, context=None): + case_obj = self.pool.get('hr.applicant') + case = case_obj.browse(cr, uid, context['active_id']) + return case.user_id and case.user_id.id or False + + def _date_category(self, cr, uid, context=None): + categ_id = self.pool.get('crm.case.categ').search(cr, uid, [('name','=','Outbound')]) + return categ_id and categ_id[0] or case.categ_id and case.categ_id.id or False + + def _get_note(self, cr, uid, context=None): + case_obj = self.pool.get('hr.applicant') + case = case_obj.browse(cr, uid, context['active_id']) + return case.description or '' + + _defaults = { + 'user_id': _date_user, + 'category_id': _date_category, + 'note': _get_note + } + + def make_phonecall(self, cr, uid, ids, context=None): + mod_obj = self.pool.get('ir.model.data') + job_case_obj = self.pool.get('hr.applicant') + data_obj = self.pool.get('ir.model.data') + phonecall_case_obj = self.pool.get('crm.phonecall') + + form = self.read(cr, uid, ids, [], context=context)[0] +# form = data['form'] + result = mod_obj._get_id(cr, uid, 'crm', 'view_crm_case_phonecalls_filter') + res = mod_obj.read(cr, uid, result, ['res_id']) + # Select the view + + id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_tree_view') + id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_phone_form_view') + if id2: + id2 = data_obj.browse(cr, uid, id2, context=context).res_id + if id3: + id3 = data_obj.browse(cr, uid, id3, context=context).res_id + + for job in job_case_obj.browse(cr, uid, context['active_ids']): + #TODO : Take other info from job + new_phonecall_id = phonecall_case_obj.create(cr, uid, { + 'name' : job.name, + 'user_id' : form['user_id'], + 'categ_id' : form['category_id'], + 'description' : form['note'], + 'date' : form['deadline'], +# 'section_id' : form['section_id'], + 'description':job.description, + 'partner_id':job.partner_id.id, + 'partner_address_id':job.partner_address_id.id, + 'partner_phone':job.partner_phone, + 'partner_mobile':job.partner_mobile, + 'description':job.description, + 'date':job.date, + }, context=context) + new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id) + vals = {} +# if not job.case_id: +# vals.update({'phonecall_id' : new_phonecall.id}) + job_case_obj.write(cr, uid, [job.id], vals) + job_case_obj.case_cancel(cr, uid, [job.id]) + phonecall_case_obj.case_open(cr, uid, [new_phonecall_id]) + + value = { + 'name': _('Phone Call'), + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'crm.phonecall', + 'res_id' : new_phonecall_id, + 'views': [(id3,'form'),(id2,'tree'),(False,'calendar'),(False,'graph')], + 'type': 'ir.actions.act_window', + 'search_view_id': res['res_id'] + } + return value + +job2phonecall() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:>>>>>>> MERGE-SOURCE diff --git a/addons/hr_recruitment/wizard/hr_recruitment_wizard.py b/addons/hr_recruitment/wizard/hr_recruitment_wizard.py deleted file mode 100644 index bd6fa8ba134..00000000000 --- a/addons/hr_recruitment/wizard/hr_recruitment_wizard.py +++ /dev/null @@ -1,273 +0,0 @@ -# -*- 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 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - -from mx.DateTime import now - -import wizard -import netsvc -import ir -import pooler -import time - -from tools.translate import _ - -class job2phonecall(wizard.interface): - case_form = """ -
- - - - - - - - - - """ - - case_fields = { - 'user_id' : {'string' : 'Assign To', 'type' : 'many2one', 'relation' : 'res.users'}, - 'deadline' : {'string' : 'Planned Date', 'type' : 'datetime'}, - 'note' : {'string' : 'Goals', 'type' : 'text'}, - 'category_id' : {'string' : 'Category', 'type' : 'many2one', 'relation' : 'crm.case.categ', 'required' : True}, - 'section_id' : {'string' : 'Section', 'type' : 'many2one', 'relation' : 'hr.case.section'}, - - } - def _default_values(self, cr, uid, data, context): - - case_obj = pooler.get_pool(cr.dbname).get('hr.applicant') - categ_id=pooler.get_pool(cr.dbname).get('crm.case.categ').search(cr, uid, [('name','=','Outbound')]) - case = case_obj.browse(cr, uid, data['id']) - return { - 'user_id' : case.user_id and case.user_id.id, - 'category_id' : categ_id and categ_id[0] or case.categ_id and case.categ_id.id, - 'section_id' : case.section_id and case.section_id.id or False, - 'note' : case.description - } - - def _doIt(self, cr, uid, data, context): - form = data['form'] - pool = pooler.get_pool(cr.dbname) - mod_obj = pool.get('ir.model.data') - result = mod_obj._get_id(cr, uid, 'hr', 'view_hr_case_phonecalls_filter') - res = mod_obj.read(cr, uid, result, ['res_id']) - phonecall_case_obj = pool.get('hr.phonecall') - job_case_obj = pool.get('hr.applicant') - # Select the view - - data_obj = pool.get('ir.model.data') - id2 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_tree_view') - id3 = data_obj._get_id(cr, uid, 'hr', 'hr_case_phone_form_view') - if id2: - id2 = data_obj.browse(cr, uid, id2, context=context).res_id - if id3: - id3 = data_obj.browse(cr, uid, id3, context=context).res_id - - for job in job_case_obj.browse(cr, uid, data['ids']): - #TODO : Take other info from job - new_phonecall_id = phonecall_case_obj.create(cr, uid, { - 'name' : job.name, - 'user_id' : form['user_id'], - 'categ_id' : form['category_id'], - 'description' : form['note'], - 'date' : form['deadline'], - 'section_id' : form['section_id'], - 'description':job.description, - 'partner_id':job.partner_id.id, - 'partner_address_id':job.partner_address_id.id, - 'partner_phone':job.partner_phone, - 'partner_mobile':job.partner_mobile, - 'description':job.description, - 'date':job.date, - }, context=context) - new_phonecall = phonecall_case_obj.browse(cr, uid, new_phonecall_id) - vals = {} - if not job.case_id: - vals.update({'phonecall_id' : new_phonecall.id}) - job_case_obj.write(cr, uid, [job.id], vals) - job_case_obj.case_cancel(cr, uid, [job.id]) - phonecall_case_obj.case_open(cr, uid, [new_phonecall_id]) - value = { - 'name': _('Phone Call'), - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'hr.phonecall', - 'res_id' : new_phonecall_id, - 'views': [(id3,'form'),(id2,'tree'),(False,'calendar'),(False,'graph')], - 'type': 'ir.actions.act_window', - 'search_view_id': res['res_id'] - } - return value - - states = { - 'init': { - 'actions': [_default_values], - 'result': {'type': 'form', 'arch': case_form, 'fields': case_fields, - 'state' : [('end', 'Cancel','gtk-cancel'),('order', 'Schedule Phone Call','gtk-go-forward')]} - }, - 'order': { - 'actions': [], - 'result': {'type': 'action', 'action': _doIt, 'state': 'end'} - } - } - -job2phonecall('hr.applicant.reschedule_phone_call') - -class job2meeting(wizard.interface): - - def _makeMeeting(self, cr, uid, data, context): - pool = pooler.get_pool(cr.dbname) - job_case_obj = pool.get('hr.applicant') - meeting_case_obj = pool.get('hr.meeting') - for job in job_case_obj.browse(cr, uid, data['ids']): - new_meeting_id = meeting_case_obj.create(cr, uid, { - 'name': job.name, - 'date': job.date, - 'duration': job.duration, - }) - new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id) - vals = {} - job_case_obj.write(cr, uid, [job.id], vals) - job_case_obj.case_cancel(cr, uid, [job.id]) - meeting_case_obj.case_open(cr, uid, [new_meeting_id]) - - data_obj = pool.get('ir.model.data') - result = data_obj._get_id(cr, uid, 'hr', 'view_hr_case_meetings_filter') - id = data_obj.read(cr, uid, result, ['res_id']) - id1 = data_obj._get_id(cr, uid, 'hr', 'hr_case_calendar_view_meet') - id2 = data_obj._get_id(cr, uid, 'hr', 'hr_case_form_view_meet') - id3 = data_obj._get_id(cr, uid, 'hr', 'hr_case_tree_view_meet') - if id1: - id1 = data_obj.browse(cr, uid, id1, context=context).res_id - if id2: - id2 = data_obj.browse(cr, uid, id2, context=context).res_id - if id3: - id3 = data_obj.browse(cr, uid, id3, context=context).res_id - return { - 'name': _('Meetings'), - 'view_type': 'form', - 'view_mode': 'calendar,form,tree', - 'res_model': 'hr.meeting', - 'view_id': False, - 'views': [(id1,'calendar'),(id2,'form'),(id3,'tree'),(False,'graph')], - 'type': 'ir.actions.act_window', - 'search_view_id': id['res_id'] - } - - states = { - 'init': { - 'actions': [], - 'result': {'type': 'action', 'action': _makeMeeting, 'state': 'order'} - }, - 'order': { - 'actions': [], - 'result': {'type': 'state', 'state': 'end'} - } - } - -job2meeting('hr.applicant.meeting_set') - - -class partner_create(wizard.interface): - - case_form = """ -
-