[IMP] remove dead code from the deprecated phonecall2partner wizard view
bzr revid: abo@openerp.com-20121112121505-0oaozvs14xr8i1gv
This commit is contained in:
parent
ef241cf6bb
commit
5b5951143c
|
@ -70,7 +70,6 @@ Dashboard for CRM will include:
|
|||
'wizard/crm_lead_to_opportunity_view.xml',
|
||||
|
||||
'wizard/crm_phonecall_to_phonecall_view.xml',
|
||||
'wizard/crm_phonecall_to_partner_view.xml',
|
||||
'wizard/crm_phonecall_to_opportunity_view.xml',
|
||||
|
||||
'wizard/crm_opportunity_to_phonecall_view.xml',
|
||||
|
|
|
@ -34,19 +34,3 @@
|
|||
!python {model: crm.lead}: |
|
||||
lead_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
|
||||
self.convert_partner(cr, uid, lead_ids, context=context)
|
||||
-
|
||||
I convert one phonecall request to a customer and put him into regular customer list.
|
||||
-
|
||||
!python {model: crm.phonecall2partner}: |
|
||||
context.update({'active_model': 'crm.phonecall', 'active_ids': [ref("crm.crm_phonecall_4")], 'active_id': ref("crm.crm_phonecall_4")})
|
||||
new_id = self.create(cr, uid, {}, context=context)
|
||||
self.make_partner(cr, uid, [new_id], context=context)
|
||||
-
|
||||
I check converted phonecall to partner.
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
partner_id = self.search(cr, uid, [('phonecall_ids', '=', ref('crm.crm_phonecall_4'))])
|
||||
assert partner_id, "Customer is not found in regular customer list."
|
||||
data = self.browse(cr, uid, partner_id, context=context)[0]
|
||||
assert data.user_id.id == ref("base.user_root"), "User not assigned properly"
|
||||
assert data.name == "Wanted information about pricing of laptops", "Bad partner name"
|
||||
|
|
|
@ -23,12 +23,9 @@ import crm_lead_to_partner
|
|||
import crm_lead_to_opportunity
|
||||
import crm_phonecall_to_phonecall
|
||||
import crm_opportunity_to_phonecall
|
||||
import crm_phonecall_to_partner
|
||||
import crm_partner_to_opportunity
|
||||
import crm_phonecall_to_opportunity
|
||||
|
||||
import crm_merge_opportunities
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class crm_phonecall2partner(osv.osv_memory):
|
||||
""" Converts phonecall to partner """
|
||||
|
||||
_name = 'crm.phonecall2partner'
|
||||
_inherit = 'crm.lead2partner'
|
||||
_description = 'Phonecall to Partner'
|
||||
|
||||
def _select_partner(self, cr, uid, context=None):
|
||||
"""
|
||||
This function Searches for Partner from selected phonecall.
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
phonecall_obj = self.pool.get('crm.phonecall')
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
rec_ids = context and context.get('active_ids', [])
|
||||
value = {}
|
||||
partner_id = False
|
||||
for phonecall in phonecall_obj.browse(cr, uid, rec_ids, context=context):
|
||||
partner_ids = partner_obj.search(cr, uid, [('name', '=', phonecall.name or phonecall.name)])
|
||||
if not partner_ids and (phonecall.partner_phone or phonecall.partner_mobile):
|
||||
partner_ids = partner_obj.search(cr, uid, ['|', ('phone', '=', phonecall.partner_phone), ('mobile','=',phonecall.partner_mobile)])
|
||||
|
||||
partner_id = partner_ids and partner_ids[0] or False
|
||||
return partner_id
|
||||
|
||||
|
||||
def _create_partner(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
This function Creates partner based on action.
|
||||
"""
|
||||
if context is None:
|
||||
context = {}
|
||||
phonecall = self.pool.get('crm.phonecall')
|
||||
data = self.browse(cr, uid, ids, context=context)[0]
|
||||
call_ids = context and context.get('active_ids') or []
|
||||
partner_id = data.partner_id and data.partner_id.id or False
|
||||
return phonecall.convert_partner(cr, uid, call_ids, data.action, partner_id, context=context)
|
||||
|
||||
crm_phonecall2partner()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Phonecall to partner confirmation form -->
|
||||
<record id="view_crm_phonecall2partner_create" model="ir.ui.view">
|
||||
<field name="name">crm.phonecall2partner.view.create</field>
|
||||
<field name="model">crm.phonecall2partner</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create a Partner" version="7.0">
|
||||
<label string="Are you sure you want to create a partner based on this Phonecall ?"/>
|
||||
<newline/>
|
||||
<label string="You may have to verify that this partner does not exist already."/>
|
||||
<footer>
|
||||
<button name="open_create_partner" string="Create Partner" type="object" groups="base.group_partner_manager" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Phonecall to partner form view -->
|
||||
<record id="view_crm_phonecall2partner" model="ir.ui.view">
|
||||
<field name="name">crm.phonecall2partner.view</field>
|
||||
<field name="model">crm.phonecall2partner</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Create a Partner" version="7.0">
|
||||
<group>
|
||||
<field name="action"/>
|
||||
<field name="partner_id" attrs="{'required':[('action','=','exist')],'invisible':[('action','!=','exist')]}" />
|
||||
</group>
|
||||
<footer>
|
||||
<button name="make_partner" string="Continue" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Phonecall to Partner wizard -->
|
||||
<record id="action_crm_phonecall2partner" model="ir.actions.act_window">
|
||||
<field name="name">Create a Partner</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">crm.phonecall2partner</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_crm_phonecall2partner_create"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue