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 @@