From defcf7f5aaeb287f6db79603fd862f2aab54774f Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Fri, 9 Jul 2010 15:57:44 +0530 Subject: [PATCH] [IMP]: crm: Added a checkbox in sales team to change responsible on escalation bzr revid: rpa@tinyerp.com-20100709102744-6mndtddixj72wcdn --- addons/crm/crm.py | 8 +++++--- addons/crm/crm_view.xml | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 5cee0052297..575c2a8a3e3 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -268,12 +268,13 @@ class crm_case(object): """ cases = self.browse(cr, uid, ids) for case in cases: - data = {'active': True, 'user_id': False} + data = {'active': True} if case.section_id.parent_id: data['section_id'] = case.section_id.parent_id.id - if case.section_id.parent_id.user_id: - data['user_id'] = case.section_id.parent_id.user_id.id + if case.section_id.parent_id.change_responsible: + if case.section_id.parent_id.user_id: + data['user_id'] = case.section_id.parent_id.user_id.id else: raise osv.except_osv(_('Error !'), _('You can not escalate, You are already at the top level regarding your sales-team category.')) self.write(cr, uid, [case.id], data) @@ -439,6 +440,7 @@ class crm_case_section(osv.osv): '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."), 'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"), + 'change_responsible': fields.boolean('Change Responsible', help="Set responsible of this Sales team on escalation to this team"), 'user_id': fields.many2one('res.users', 'Responsible User'), 'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'), 'reply_to': fields.char('Reply-To', size=64, help="The email address put \ diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index a3d9f14273e..74786ad91f6 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -43,6 +43,7 @@ +