diff --git a/addons/crm/crm.py b/addons/crm/crm.py index d7e1fba40e9..bb2a71f55fd 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 = [ @@ -234,4 +236,13 @@ class crm_payment_mode(osv.osv): 'section_id': fields.many2one('crm.case.section', 'Sales Team'), } + +class base_config_settings(osv.osv_memory): + _inherit = 'base.config.settings' + _columns = { + 'group_multi_salesteams': fields.boolean("Use mutli sales teams", + implied_group='base.group_multi_salesteams', + help=""" """), + } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_case_section_view.xml b/addons/crm/crm_case_section_view.xml index c92da5ee426..73f99707eda 100644 --- a/addons/crm/crm_case_section_view.xml +++ b/addons/crm/crm_case_section_view.xml @@ -27,20 +27,6 @@ - - @@ -74,6 +60,7 @@ crm.case.section + @@ -84,7 +71,7 @@ -
+
í
    @@ -95,18 +82,18 @@

-
+
%%
-
- + -
+
@@ -147,23 +134,31 @@
+
+
- - - - - - + + + + + @@ -271,15 +266,25 @@ - + + base.config.settings.crm + base.config.settings + + + +
+ +
+
+
+
+ groups="base.group_multi_salesteams"/> \ No newline at end of file diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 205e0122709..c4366f4d903 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -85,9 +85,9 @@ class crm_lead(base_stage, format_address, osv.osv): } def get_empty_list_help(self, cr, uid, help, context=None): - if context.get('default_type', None) == 'lead': + if context.get('default_type') == 'lead': context['empty_list_help_model'] = 'crm.case.section' - context['empty_list_help_id'] = context.get('default_section_id', None) + context['empty_list_help_id'] = context.get('default_section_id') context['empty_list_help_document_name'] = _("leads") return super(crm_lead, self).get_empty_list_help(cr, uid, help, context=context) diff --git a/addons/crm/crm_lead_menu.xml b/addons/crm/crm_lead_menu.xml index 00b328fd4aa..bcc105ddc2b 100644 --- a/addons/crm/crm_lead_menu.xml +++ b/addons/crm/crm_lead_menu.xml @@ -9,10 +9,7 @@ ['|', ('type','=','lead'), ('type','=',False)] - { - 'default_type':'lead', - 'stage_type':'lead' - } + {'default_type':'lead', 'stage_type':'lead', 'search_default_unassigned':1}

Use leads if you need a qualification step before creating an @@ -26,20 +23,6 @@ - - Opportunities crm.lead diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index ac743b05794..29d428ff2b9 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -153,8 +153,8 @@ -

+