From 8bf6b530d2c573e303d9111f601aa60ad65d4f89 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 18 Jun 2015 14:07:52 +0530 Subject: [PATCH] [IMP] sale, sales_team, crm: usability improvements - sales_team: remove field note, usability improvement in kanban and form views - crm: in crm.stage remove default_case, sequence and legend_priority fields and remove default stage_ids + some fields in technical group - sale: add field use_invoices on sales_team and display links in dashboard according to this new field --- addons/crm/__openerp__.py | 1 + addons/crm/crm.py | 5 +- addons/crm/crm_lead.py | 9 ++- addons/crm/crm_lead_data.xml | 68 ------------------- addons/crm/crm_lead_view.xml | 2 +- addons/crm/crm_view.xml | 7 +- addons/crm/data/crm_stage_demo.xml | 67 ++++++++++++++++++ addons/crm/sales_team.py | 5 -- addons/crm/sales_team_view.xml | 4 +- addons/crm/test/lead2opportunity2win.yml | 13 ---- .../crm_partner_assign_data.xml | 2 - addons/sale/sales_team.py | 9 +-- addons/sale/sales_team_dashboard.xml | 43 ++++++------ addons/sale/sales_team_view.xml | 6 +- addons/sales_team/sales_team.py | 1 - addons/sales_team/sales_team.xml | 17 ++--- addons/sales_team/sales_team_dashboard.xml | 1 - 17 files changed, 118 insertions(+), 142 deletions(-) create mode 100644 addons/crm/data/crm_stage_demo.xml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 6c15e7d674a..11794a9158c 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -77,6 +77,7 @@ Dashboard for CRM will include: 'sales_team_dashboard.xml', ], 'demo': [ + 'data/crm_stage_demo.xml', 'crm_demo.xml', 'crm_lead_demo.xml', 'data/crm_action_demo.xml', diff --git a/addons/crm/crm.py b/addons/crm/crm.py index bd9c80581b5..e7b07dbc753 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -27,11 +27,9 @@ class crm_stage(osv.Model): 'sequence': fields.integer('Sequence', help="Used to order stages. Lower is better."), 'probability': fields.float('Probability (%)', required=True, help="This percentage depicts the default/average probability of the Case for this stage to be a success"), 'on_change': fields.boolean('Change Probability Automatically', help="Setting this stage will change the probability automatically on the opportunity."), - 'requirements': fields.text('Requirements'), + 'requirements': fields.text('Requirements', help="Enter here the internal requirements for this stage (ex: Offer sent to customer). It will appear as a tooltip over the stage's name."), 'team_ids': fields.many2many('crm.team', 'crm_team_stage_rel', 'stage_id', 'team_id', string='Teams', help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."), - 'case_default': fields.boolean('Default to New Sales Team', - help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."), 'legend_priority': fields.text( 'Priority Management Explanation', translate=True, help='Explanation text to help users using the star and priority mechanism on stages or issues that are in this stage.'), @@ -48,5 +46,4 @@ class crm_stage(osv.Model): 'probability': 1.0, 'fold': False, 'type': 'both', - 'case_default': True, } diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index cf471442247..5f3da3ad81f 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -88,7 +88,7 @@ class crm_lead(format_address, osv.osv): order = "%s desc" % order # retrieve team_id from the context and write the domain # - ('id', 'in', 'ids'): add columns that should be present - # - OR ('case_default', '=', True), ('fold', '=', False): add default columns that are not folded + # - OR ('fold', '=', False): add default columns that are not folded # - OR ('team_ids', '=', team_id), ('fold', '=', False) if team_id: add team columns that are not folded search_domain = [] team_id = self.pool['crm.team']._resolve_team_id_from_context(cr, uid, context=context) @@ -96,7 +96,7 @@ class crm_lead(format_address, osv.osv): search_domain += ['|', ('team_ids', '=', team_id)] search_domain += [('id', 'in', ids)] else: - search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)] + search_domain += [('id', 'in', ids)] # retrieve type from the context (if set: choose 'type' or 'both') type = self._resolve_type_from_context(cr, uid, context=context) if type: @@ -324,13 +324,12 @@ class crm_lead(format_address, osv.osv): team_ids.add(lead.team_id.id) if lead.type not in types: types.append(lead.type) - # OR all team_ids and OR with case_default + # OR all team_ids search_domain = [] if team_ids: - search_domain += [('|')] * len(team_ids) + search_domain += [('|')] * (len(team_ids) - 1) for team_id in team_ids: search_domain.append(('team_ids', '=', team_id)) - search_domain.append(('case_default', '=', True)) # AND with cases types if not avoid_add_type_term: search_domain.append(('type', 'in', types)) diff --git a/addons/crm/crm_lead_data.xml b/addons/crm/crm_lead_data.xml index cd9a0cd8ebc..c68a9f1ceb5 100644 --- a/addons/crm/crm_lead_data.xml +++ b/addons/crm/crm_lead_data.xml @@ -1,74 +1,6 @@ - - - - New - 1 - 0 - 1 - 1 - both - - - Dead - 1 - 1 - 0 - 1 - 30 - lead - - - Qualification - 1 - 20 - 1 - 40 - opportunity - - - Proposition - 1 - 40 - 1 - 50 - opportunity - - - Negotiation - 1 - 60 - 1 - 60 - opportunity - - - Won - 1 - 1 - 100 - 1 - 70 - opportunity - - - Lost - 1 - 1 - 0 - 1 - 80 - opportunity - - - - - diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 48df360b719..5ba5b7412ac 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -107,7 +107,7 @@