[IMP] sales_team : Remove the lead escalation feature

Conflicts:
	addons/crm/sales_team_view.xml
	addons/sales_team/sales_team.py
	addons/sales_team/sales_team.xml
This commit is contained in:
Yannick Tivisse
2015-07-08 15:39:02 +02:00
parent 6c64869de1
commit 55ae657239
7 changed files with 14 additions and 31 deletions
-14
View File
@@ -381,20 +381,6 @@ class crm_lead(format_address, osv.osv):
self.write(cr, uid, lead_ids, {'stage_id': stage_id}, context=context)
return True
def case_escalate(self, cr, uid, ids, context=None):
""" Escalates case to parent level """
for case in self.browse(cr, uid, ids, context=context):
data = {'active': True}
if case.team_id.parent_id:
data['team_id'] = case.team_id.parent_id.id
if case.team_id.parent_id.change_responsible:
if case.team_id.parent_id.user_id:
data['user_id'] = case.team_id.parent_id.user_id.id
else:
raise UserError(_("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
self.write(cr, uid, [case.id], data, context=context)
return True
def _merge_get_result_type(self, cr, uid, opps, context=None):
"""
Define the type of the result of the merge. If at least one of the
-5
View File
@@ -167,9 +167,6 @@
<label for="team_id" groups="base.group_multi_salesteams"/>
<div class="o_row" groups="base.group_multi_salesteams">
<field name="team_id"/>
<button name="case_escalate" string="Escalate"
type="object" class="oe_link"
attrs="{'invisible': ['|', ('team_id','=',False), ('probability', '=', 100)]}"/>
</div>
<field name="type" invisible="1"/>
</group>
@@ -457,8 +454,6 @@
<label for="team_id" groups="base.group_multi_salesteams"/>
<div groups="base.group_multi_salesteams" class="o_row">
<field name="team_id" widget="selection"/>
<button name="case_escalate" string="Escalate" type="object" class="oe_link"
attrs="{'invisible': ['|', ('team_id','=',False), ('probability', '=', 100)]}"/>
</div>
</group>
<group>
+2 -2
View File
@@ -94,8 +94,8 @@
<field name="stage_ids"/>
</page>
</xpath>
<xpath expr="//group[@name='sales_team_escalation_group']" position="after">
<group name="alias_info" string="Leads Email Alias" attrs="{'invisible': [('alias_domain', '=', False)]}">
<xpath expr="//field[@name='active']" position="before">
<group name="alias_info" string="Leads Email Alias" class="oe_inline" attrs="{'invisible': [('alias_domain', '=', False)]}">
<label for="alias_name" string="Email Alias"
attrs="{'invisible': [('alias_domain', '=', False)]}"/>
<div name="alias_def"
-10
View File
@@ -12,13 +12,3 @@
-
!assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in new stage}:
- stage_id.sequence == 1
-
Salesman escalate the lead to parent team.
-
!python {model: crm.lead}: |
self.case_escalate(cr, uid, [ref("crm_case_1")])
-
Salesman check the lead is correctly escalated to the parent team.
-
!assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}:
- team_id.name == "Marketing"
+6
View File
@@ -130,3 +130,9 @@ class crm_helpdesk_category(osv.Model):
'name': fields.char('Name', required=True, translate=True),
'team_id': fields.many2one('crm.team', 'Sales Team'),
}
class sales_team(osv.Model):
_inherit = "crm.team"
_columns = {
'change_responsible': fields.boolean('Reassign Escalated', help="When escalating to this team override the salesman with the team leader."),
}
+3
View File
@@ -44,8 +44,11 @@ class crm_team(osv.Model):
'code': fields.char('Code', size=8),
'active': fields.boolean('Active', help="If the active field is set to "\
"true, it will allow you to hide the sales team without removing it."),
<<<<<<< HEAD
'company_id': fields.many2one('res.company', 'Company'),
'change_responsible': fields.boolean('Reassign Escalated', help="When escalating to this team override the salesman with the team leader."),
=======
>>>>>>> 7857b36... [IMP] sales_team : Remove the lead escalation feature
'user_id': fields.many2one('res.users', 'Team Leader'),
'member_ids': fields.many2many('res.users', 'sale_member_rel', 'team_id', 'member_id', 'Team Members'),
'reply_to': fields.char('Reply-To', size=64, help="The email address put in the 'Reply-To' of all emails sent by Odoo about cases in this sales team"),
+3
View File
@@ -92,10 +92,13 @@
</page>
<page string="More Info" groups="base.group_sale_manager">
<group name="sales_team_more_info">
<<<<<<< HEAD
<group string="Escalation" name="sales_team_escalation_group">
<field name="parent_id"/>
<field name="change_responsible"/>
</group>
=======
>>>>>>> 7857b36... [IMP] sales_team : Remove the lead escalation feature
<group>
<field name="active"/>
<field name="company_id" groups="base.group_multi_company"