diff --git a/addons/crm/__terp__.py b/addons/crm/__terp__.py index 994f11f3212..7a248005578 100644 --- a/addons/crm/__terp__.py +++ b/addons/crm/__terp__.py @@ -61,8 +61,10 @@ between mails and Open ERP.""", ], 'update_xml': [ + 'wizard/crm_phonecall2phonecall.xml', 'crm_wizard.xml', - 'crm_view.xml', + 'crm_view.xml', + 'crm_action_rule_view.xml', 'crm_lead_wizard.xml', 'crm_lead_view.xml', diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py index 62be2041d98..73c4596a145 100644 --- a/addons/crm/wizard/__init__.py +++ b/addons/crm/wizard/__init__.py @@ -26,6 +26,7 @@ import crm_phonecall_wizard import wizard_crm_send_email import wizard_crm_new_send_email import wizard_history_event +import crm_phonecall2phonecall # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/wizard/crm_phonecall2phonecall.py b/addons/crm/wizard/crm_phonecall2phonecall.py new file mode 100644 index 00000000000..81f11d2f95b --- /dev/null +++ b/addons/crm/wizard/crm_phonecall2phonecall.py @@ -0,0 +1,73 @@ +# -*- encoding: utf-8 -*- +############################################################################################ +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# Copyright (C) 2008-2009 AJM Technologies S.A. (. +# +############################################################################################ +############################################################################################ + +from osv import osv, fields +import netsvc +import time +import tools +import mx.DateTime +from tools import config +from tools.translate import _ +import tools + +class crm_phonecall2phonecall(osv.osv_memory): + _name = 'crm.phonecall2phonecall' + _description = 'Phonecall To Phonecall' + + def action_cancel(self, cr, uid, ids, context=None): + return {'type':'ir.actions.act_window_close'} + + def action_apply(self, cr, uid, ids, context=None): + this = self.browse(cr, uid, ids)[0] + + record_id = context and context.get('record_id', False) or False + print ">>>>>>>>>>",record_id + values={} + values['name']=this.name + values['user_id']=this.user_id and this.user_id.id + values['category_id']=this.category_id and this.category_id.id + values['section_id']=this.section_id and this.section_id.id or False, + values['description']=this.notes + phonecall_proxy = self.pool.get('crm.phonecall') + phonecall_id = phonecall_proxy.create(cr, uid, values, context=context) + value = { + 'name': _('Phone Call'), + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'crm.phonecall', + 'view_id': False, + 'type': 'ir.actions.act_window', + 'res_id': phonecall_id + } + return value + + _columns = { + 'name' : fields.char('Name', size=64, required=True, select=1), + 'user_id' : fields.many2one('res.users',"Assign To"), + 'deadline': fields.datetime('Deadline', readonly=True), + 'category_id' : fields.many2one('crm.case.categ','Category',domain="[('object_id.model', '=', ''crm.phonecall')]"), + 'section_id':fields.many2one('crm.case.section','Section Id'), + 'notes' : fields.text('Notes'), + } +crm_phonecall2phonecall() \ No newline at end of file diff --git a/addons/crm/wizard/crm_phonecall2phonecall.xml b/addons/crm/wizard/crm_phonecall2phonecall.xml new file mode 100644 index 00000000000..ea30368243e --- /dev/null +++ b/addons/crm/wizard/crm_phonecall2phonecall.xml @@ -0,0 +1,33 @@ + + + + + crm.phonecall2phonecall.form + crm.phonecall2phonecall + form + +
+ + + + + + +