[FIX] crm: While processing the 'Convert to Opportunity' wizard in leads view, if the system found matching partner from the information provided in lead and suggested that partner in the wizard, and later if we decided not to link the opportunity to existing partner but to create a new one, it never create one, but will link to the priorly suggested partner: (Maintenance Case : 596231)

lp bug: https://launchpad.net/bugs/1208436 fixed

bzr revid: rgo@tinyerp.com-20130807094630-efk7yo1ia27vpq5i
This commit is contained in:
Ravi Gohil (OpenERP) 2013-08-07 15:16:30 +05:30
parent 8938503a39
commit f8d47a4a1d
2 changed files with 4 additions and 1 deletions

View File

@ -37,6 +37,9 @@ class crm_lead2opportunity_partner(osv.osv_memory):
'opportunity_ids': fields.many2many('crm.lead', string='Opportunities'),
}
def onchange_action(self, cr, uid, ids, action, context=None):
return {'value': {'partner_id': False if action != 'exist' else self._find_matching_partner(cr, uid, context=context)}}
def default_get(self, cr, uid, fields, context=None):
"""
Default get for name, opportunity_ids.

View File

@ -27,7 +27,7 @@
</field>
</group>
<group name="action" attrs="{'invisible': [('name', '!=', 'convert')]}">
<field name="action" class="oe_inline"/>
<field name="action" on_change="onchange_action(action, context)" class="oe_inline"/>
<field name="partner_id"
attrs="{'required': [('action', '=', 'exist')], 'invisible':[('action','!=','exist')]}"
class="oe_inline"/>