From a4d3976caffcb6ecae5554911a3b8d444ace754a Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 25 Mar 2013 11:25:55 +0100 Subject: [PATCH] [IMP] sales teams: in progress bzr revid: chm@openerp.com-20130325102555-5q3j1y5dapohgax5 --- addons/crm/crm.py | 6 ++++-- addons/crm/crm_case_section_view.xml | 27 ++++++++++++++++++--------- addons/crm/crm_lead.py | 4 ++-- addons/crm/static/src/css/crm.css | 3 +++ 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index d7e1fba40e9..257e69e1542 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -129,10 +129,11 @@ class crm_case_section(osv.osv): help="The email address associated with this team. New emails received will automatically " "create new leads assigned to the team."), 'open_lead_ids': fields.one2many('crm.lead', 'section_id', 'Leads', readonly=True, - domain=[('type', '!=', 'opportunity'), ('state', 'not in', ['done', 'cancel'])]), + domain=['&', ('type', '!=', 'opportunity'), ('state', 'not in', ['done', 'cancel'])]), 'open_opportunity_ids': fields.one2many('crm.lead', 'section_id', 'Opportunities', readonly=True, - domain=['&', ('type', '=', 'opportunity'), ('type', '=', 'both'), ('state', 'not in', ['done', 'cancel'])]), + domain=['&', '|', ('type', '=', 'opportunity'), ('type', '=', 'both'), ('state', 'not in', ['done', 'cancel'])]), 'color': fields.integer('Color Index'), + 'use_leads': fields.boolean('Leads', help="If checked, this sales teams will be available in the sales teams menu and you will be able to manage leads"), } def _get_stage_common(self, cr, uid, context): @@ -142,6 +143,7 @@ class crm_case_section(osv.osv): _defaults = { 'active': 1, 'stage_ids': _get_stage_common, + 'use_leads': True, } _sql_constraints = [ diff --git a/addons/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml index 82e337e0db3..446664ae7b9 100644 --- a/addons/crm/crm_case_section_view.xml +++ b/addons/crm/crm_case_section_view.xml @@ -74,6 +74,7 @@ crm.case.section + @@ -95,11 +96,11 @@