diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 08266d8a3c4..9e9cf42a5bc 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -97,7 +97,6 @@ Dashboard for CRM will include: 'board_crm_view.xml', 'res_config_view.xml', - ], 'demo': [ 'crm_demo.xml', diff --git a/addons/crm/test/process/lead2opportunity2win.yml b/addons/crm/test/process/lead2opportunity2win.yml index 0523c2d6296..981a11a59ed 100644 --- a/addons/crm/test/process/lead2opportunity2win.yml +++ b/addons/crm/test/process/lead2opportunity2win.yml @@ -13,13 +13,13 @@ - I fill in a lead2partner wizard. - - !record {model: crm.lead2partner, id: crm_lead2partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_4")]}'}: + !record {model: crm.generate.partner, id: crm_generate_partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_4")]}'}: - I create a partner from the lead2partner wizard. - - !python {model: crm.lead2partner}: | + !python {model: crm.generate.partner}: | context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_4')], 'active_id': ref('crm_case_4')}) - self.make_partner(cr, uid ,[ref("crm_lead2partner_id1")], context=context) + self.make_partner(cr, uid ,[ref("crm_generate_partner_id1")], context=context) - I convert lead into opportunity for exiting customer. - diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py index d3849af2308..ea522a036b8 100644 --- a/addons/crm/wizard/__init__.py +++ b/addons/crm/wizard/__init__.py @@ -19,13 +19,12 @@ # ############################################################################## -import crm_lead_to_partner -import crm_lead_to_opportunity +import crm_generate_partner import crm_phonecall_to_phonecall import crm_opportunity_to_phonecall +import crm_lead_to_opportunity import crm_partner_to_opportunity import crm_phonecall_to_opportunity import crm_merge_opportunities # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/crm/wizard/crm_lead_to_partner.py b/addons/crm/wizard/crm_generate_partner.py similarity index 88% rename from addons/crm/wizard/crm_lead_to_partner.py rename to addons/crm/wizard/crm_generate_partner.py index 0e4c5b77a8d..6e7c31d69a7 100644 --- a/addons/crm/wizard/crm_lead_to_partner.py +++ b/addons/crm/wizard/crm_generate_partner.py @@ -22,9 +22,15 @@ from osv import osv, fields from tools.translate import _ -class crm_lead2partner(osv.osv_memory): - _name = 'crm.lead2partner' - _description = 'Generate a partner from a CRM item (lead, phonecall, ...) either by explicitly converting the element to a partner, either by triggering an action that will create a partner (e.g. convert a lead into an opportunity).' +class crm_generate_partner(osv.osv_memory): + """ + Handle the partner generation from any CRM item (lead, phonecall, ...) + either by explicitly converting the element to a partner, either by + triggering an action that will create a partner (e.g. convert a lead into + an opportunity). + """ + _name = 'crm.generate.partner' + _description = 'Generate a partner from a CRM item.' _columns = { 'action': fields.selection([ ('exist', 'Link to an existing customer'), @@ -36,7 +42,8 @@ class crm_lead2partner(osv.osv_memory): def _find_matching_partner(self, cr, uid, context=None): """ - Try to find a matching partner regarding the active model data, like the customer's name, email, phone number, etc. + Try to find a matching partner regarding the active model data, like + the customer's name, email, phone number, etc. @return partner_id if any, False otherwise """ if context is None: @@ -67,7 +74,7 @@ class crm_lead2partner(osv.osv_memory): return partner_id def default_get(self, cr, uid, fields, context=None): - res = super(crm_lead2partner, self).default_get(cr, uid, fields, context=context) + res = super(crm_generate_partner, self).default_get(cr, uid, fields, context=context) partner_id = self._find_matching_partner(cr, uid, context=context) if 'action' in fields: diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index 8fccd8ba219..eea1e90a254 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -27,7 +27,7 @@ import re class crm_lead2opportunity_partner(osv.osv_memory): _name = 'crm.lead2opportunity.partner' _description = 'Lead To Opportunity Partner' - _inherit = 'crm.lead2partner' + _inherit = 'crm.generate.partner' _columns = { 'name': fields.selection([ diff --git a/addons/crm/wizard/crm_lead_to_opportunity_view.xml b/addons/crm/wizard/crm_lead_to_opportunity_view.xml index 3390ad8f547..415e02587e1 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity_view.xml +++ b/addons/crm/wizard/crm_lead_to_opportunity_view.xml @@ -7,7 +7,7 @@ crm.lead2opportunity.partner
- + @@ -18,7 +18,7 @@ - +