[Add] add wizard of crm_phonecall2phonecall

bzr revid: sbh@tinyerp.com-20100308060048-a5qqd4zf3qwdfvek
This commit is contained in:
sbh (Open ERP) 2010-03-08 11:30:48 +05:30
parent e5f3ead146
commit 1f8c978286
4 changed files with 110 additions and 1 deletions

View File

@ -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',

View File

@ -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:

View File

@ -0,0 +1,73 @@
# -*- encoding: utf-8 -*-
############################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# Copyright (C) 2008-2009 AJM Technologies S.A. (<http://www.ajm.lu). 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 <http://www.gnu.org/licenses/>.
#
############################################################################################
############################################################################################
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()

View File

@ -0,0 +1,33 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="phonecall_to_phonecall_view">
<field name="name">crm.phonecall2phonecall.form</field>
<field name="model">crm.phonecall2phonecall</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Schedule Other Cal" col="2">
<field name="name"/>
<field name="user_id" />
<field name="category_id" />
<field name="section_id"/>
<field name="notes"/>
<group colspan="2" col="2" >
<button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
<button name="action_apply" type="object" string="_Apply" icon="gtk-apply" />
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="phonecall_to_phonecall_act">
<field name="name">Schedule Other Call</field>
<field name="res_model">crm.phonecall2phonecall</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="phonecall_to_phonecall_view"/>
<field name="target">new</field>
<field name="context">{'record_id' : False}</field>
</record>
</data>
</openerp>