[IMP] rename lead2partner (again) into crm.partner.binding; also rephrase the documentation
bzr revid: abo@openerp.com-20121113172235-j6ngsolg0wbu84yg
This commit is contained in:
parent
3067d2feaa
commit
e6bfe6583e
|
@ -13,13 +13,13 @@
|
|||
-
|
||||
I fill in a lead2partner wizard.
|
||||
-
|
||||
!record {model: crm.generate.partner, id: crm_generate_partner_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_4")]}'}:
|
||||
!record {model: crm.partner.binding, id: crm_partner_binding_id1, context: '{"active_model": "crm.lead", "active_ids": [ref("crm_case_4")]}'}:
|
||||
-
|
||||
I create a partner from the lead2partner wizard.
|
||||
-
|
||||
!python {model: crm.generate.partner}: |
|
||||
!python {model: crm.partner.binding}: |
|
||||
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_generate_partner_id1")], context=context)
|
||||
self.make_partner(cr, uid ,[ref("crm_partner_binding_id1")], context=context)
|
||||
-
|
||||
I convert lead into opportunity for exiting customer.
|
||||
-
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import crm_generate_partner
|
||||
import crm_partner_binding
|
||||
import crm_phonecall_to_phonecall
|
||||
import crm_opportunity_to_phonecall
|
||||
import crm_lead_to_opportunity
|
||||
|
|
|
@ -27,7 +27,7 @@ import re
|
|||
class crm_lead2opportunity_partner(osv.osv_memory):
|
||||
_name = 'crm.lead2opportunity.partner'
|
||||
_description = 'Lead To Opportunity Partner'
|
||||
_inherit = 'crm.generate.partner'
|
||||
_inherit = 'crm.partner.binding'
|
||||
|
||||
_columns = {
|
||||
'name': fields.selection([
|
||||
|
|
|
@ -22,15 +22,17 @@
|
|||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class crm_generate_partner(osv.osv_memory):
|
||||
class crm_partner_binding(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).
|
||||
Handle the partner binding or generation in any CRM wizard that requires
|
||||
such feature, like the lead2opportunity wizard, or the
|
||||
phonecall2opportunity wizard. Try to find a matching partner from the
|
||||
CRM model's information (name, email, phone number, etc) or create a new
|
||||
one on the fly.
|
||||
Use it like a mixin with the wizard of your choice.
|
||||
"""
|
||||
_name = 'crm.generate.partner'
|
||||
_description = 'Generate a partner from a CRM item.'
|
||||
_name = 'crm.partner.binding'
|
||||
_description = 'Handle partner binding or generation in CRM wizards.'
|
||||
_columns = {
|
||||
'action': fields.selection([
|
||||
('exist', 'Link to an existing customer'),
|
||||
|
@ -80,7 +82,7 @@ class crm_generate_partner(osv.osv_memory):
|
|||
return partner_id
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
res = super(crm_generate_partner, self).default_get(cr, uid, fields, context=context)
|
||||
res = super(crm_partner_binding, self).default_get(cr, uid, fields, context=context)
|
||||
partner_id = self._find_matching_partner(cr, uid, context=context)
|
||||
|
||||
if 'action' in fields:
|
Loading…
Reference in New Issue