[REM] : remove wizard of schedule/log a call ,

[IMP] : Rename in Opportunity and in Partner form the 'Meeting' into 'Schedule a Meeting' ,

bzr revid: aja@tinyerp.com-20130822092259-it5a1e1v1ed9s60a
This commit is contained in:
ajay javiya (OpenERP) 2013-08-22 14:52:59 +05:30
parent 525aee7a86
commit a0ab757537
10 changed files with 23 additions and 142 deletions

View File

@ -71,8 +71,6 @@ Dashboard for CRM will include:
'wizard/crm_phonecall_to_phonecall_view.xml',
'wizard/crm_opportunity_to_phonecall_view.xml',
'wizard/crm_merge_opportunities_view.xml',
'crm_view.xml',

View File

@ -103,9 +103,9 @@
</header>
<sheet>
<div class="oe_right oe_button_box" name="buttons">
<button string="Schedule/Log Call"
name="%(opportunity2phonecall_act)d"
type="action"/>
<button class="oe_inline" type="action" string="Calls"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
@ -277,7 +277,7 @@
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
<li><a name="%(mail.action_email_compose_message_wizard)d" type="action">Send Email</a></li>
<li><a name="%(opportunity2phonecall_act)d" type="action">Schedule/Log Call</a></li>
<li><a type="action" name="%(crm.crm_case_categ_phone_incoming0)d" >Calls</a></li>
<li><a name="action_makeMeeting" type="object">Schedule Meeting</a></li>
<li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
</ul>
@ -387,10 +387,11 @@
</header>
<sheet>
<div class="oe_right oe_button_box">
<button string="Schedule/Log Call" type="action"
name="%(opportunity2phonecall_act)d"/>
<button string="Meeting" type="object"
name="action_makeMeeting"
<button class="oe_inline" type="action" string="Calls"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />
<button string="Schedule Meeting" type="action"
name="%(base_calendar.action_crm_meeting)d"
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/>
</div>
<div class="oe_title">

View File

@ -65,6 +65,9 @@ class crm_configuration(osv.TransientModel):
'group_multi_salesteams': fields.boolean("Organize Sales activities into multiple Sales Teams",
implied_group='base.group_multi_salesteams',
help="""Allows you to use Sales Teams to manage your leads and opportunities."""),
'group_scheduled_calls_menu': fields.boolean("Hide Scheduled Calls Menu",
implied_group='crm.group_scheduled_calls_menu',
help="""Allows to hide Scheduled Calls Menu in Sales/Phone Calls Menu""")
}

View File

@ -20,6 +20,10 @@
<field name="module_crm_helpdesk" class="oe_inline"/>
<label for="module_crm_helpdesk"/>
</div>
<div>
<field name="group_scheduled_calls_menu" class="oe_inline"/>
<label for="group_scheduled_calls_menu"/>
</div>
</div>
</group>
<separator string="Sales Teams"/>

View File

@ -95,7 +95,7 @@
name="%(crm.crm_case_category_act_oppor11)d"
context="{'search_default_partner_id': active_id}"/>
<button class="oe_inline" type="action"
string="Meetings"
string="Schedule Meetings"
name="%(base_calendar.action_crm_meeting)d"
context="{'search_default_partner_ids': active_id, 'default_partner_ids' : [active_id]}"/>
<button class="oe_inline" type="action" string="Calls"

View File

@ -41,6 +41,11 @@
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_scheduled_calls_menu" model="res.groups">
<field name="name">Hide Scheduled Calls Menu</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record model="res.users" id="base.user_root">
<field eval="[(4,ref('base.group_partner_manager'))]" name="groups_id"/>
</record>

View File

@ -26,7 +26,7 @@
-
Now I begin communication and schedule a phone call with the customer.
-
!python {model: crm.opportunity2phonecall}: |
!python {model: crm.phonecall}: |
import time
context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_3')]})
call_id = self.create(cr, uid, {'date': time.strftime('%Y-%m-%d %H:%M:%S'),

View File

@ -21,7 +21,6 @@
import crm_partner_binding
import crm_phonecall_to_phonecall
import crm_opportunity_to_phonecall
import crm_lead_to_opportunity
import crm_merge_opportunities

View File

@ -1,77 +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 openerp.osv import fields, osv
from openerp.tools.translate import _
import time
class crm_opportunity2phonecall(osv.osv_memory):
"""Converts Opportunity to Phonecall"""
_inherit = 'crm.phonecall2phonecall'
_name = 'crm.opportunity2phonecall'
_description = 'Opportunity to Phonecall'
def default_get(self, cr, uid, fields, context=None):
opp_obj = self.pool.get('crm.lead')
categ_id = False
data_obj = self.pool.get('ir.model.data')
res_id = data_obj._get_id(cr, uid, 'crm', 'categ_phone2')
if res_id:
categ_id = data_obj.browse(cr, uid, res_id, context=context).res_id
record_ids = context and context.get('active_ids', []) or []
res = {}
res.update({'action': 'log', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
for opp in opp_obj.browse(cr, uid, record_ids, context=context):
if 'name' in fields:
res.update({'name': opp.name})
if 'user_id' in fields:
res.update({'user_id': opp.user_id and opp.user_id.id or False})
if 'section_id' in fields:
res.update({'section_id': opp.section_id and opp.section_id.id or False})
if 'categ_id' in fields:
res.update({'categ_id': categ_id})
if 'partner_id' in fields:
res.update({'partner_id': opp.partner_id and opp.partner_id.id or False})
if 'contact_name' in fields:
res.update({'contact_name': opp.partner_id and opp.partner_id.name or False})
if 'phone' in fields:
res.update({'phone': opp.phone or (opp.partner_id and opp.partner_id.phone or False)})
return res
def action_schedule(self, cr, uid, ids, context=None):
value = {}
if context is None:
context = {}
phonecall = self.pool.get('crm.phonecall')
opportunity_ids = context and context.get('active_ids') or []
opportunity = self.pool.get('crm.lead')
data = self.browse(cr, uid, ids, context=context)[0]
call_ids = opportunity.schedule_phonecall(cr, uid, opportunity_ids, data.date, data.name, \
data.note, data.phone, data.contact_name, data.user_id and data.user_id.id or False, \
data.section_id and data.section_id.id or False, \
data.categ_id and data.categ_id.id or False, \
action=data.action, context=context)
return {'type': 'ir.actions.act_window_close'}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,52 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- Opportunity to Phonecall view -->
<record model="ir.ui.view" id="opportunity2phonecall_view">
<field name="name">crm.opportunity2phonecall.form</field>
<field name="model">crm.opportunity2phonecall</field>
<field name="arch" type="xml">
<form string="Schedule/Log a Call" version="7.0">
<group>
<group>
<field name="action"/>
<field name="name"/>
<field name="categ_id" string="Type"
widget="selection"
domain="[('object_id.model', '=', 'crm.phonecall')]"
groups="base.group_no_one"/>
<field name="date" string="Planned Date" attrs="{'invisible': [('action','=','log')]}"/>
</group>
<group>
<field name="partner_id" readonly="True"/>
<field name="phone"/>
<field name="user_id" attrs="{'invisible': [('action','=','log')]}"/>
<field name="section_id" widget="selection" attrs="{'invisible': [('action','=','log')]}" groups="base.group_multi_salesteams"/>
</group>
</group>
<field name="note" placeholder="Call Description" />
<footer>
<button name="action_schedule" type="object" string="Log call" attrs="{'invisible' : [('action', '!=', 'log')]}" class="oe_highlight"/>
<button name="action_schedule" type="object" string="Schedule Call" attrs="{'invisible' : [('action', '!=', 'schedule')]}" class="oe_highlight" />
or
<button name="action_cancel" string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<!-- Opportunity to Phonecall action -->
<record model="ir.actions.act_window" id="opportunity2phonecall_act">
<field name="name">Schedule/Log Call</field>
<field name="res_model">crm.opportunity2phonecall</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="opportunity2phonecall_view"/>
<field name="target">new</field>
</record>
</data>
</openerp>