← Back to team overview

credativ team mailing list archive

[Branch ~credativ/openobject-addons/6.1] Rev 7075: Clear partner_id if not linking/creating.

 

------------------------------------------------------------
revno: 7075
committer: Ondřej Kuzník <ondrej.kuznik@xxxxxxxxxxxxxx>
branch nick: addons61
timestamp: Thu 2015-11-19 17:26:14 +0000
message:
  Clear partner_id if not linking/creating.
modified:
  crm/wizard/crm_lead_to_opportunity.py


--
lp:~credativ/openobject-addons/6.1
https://code.launchpad.net/~credativ/openobject-addons/6.1

Your team credativ is subscribed to branch lp:~credativ/openobject-addons/6.1.
To unsubscribe from this branch go to https://code.launchpad.net/~credativ/openobject-addons/6.1/+edit-subscription
=== modified file 'crm/wizard/crm_lead_to_opportunity.py'
--- crm/wizard/crm_lead_to_opportunity.py	2012-04-25 08:56:59 +0000
+++ crm/wizard/crm_lead_to_opportunity.py	2015-11-19 17:26:14 +0000
@@ -147,6 +147,8 @@
         lead = self.pool.get('crm.lead')
         lead_ids = context.get('active_ids', [])
         data = self.browse(cr, uid, ids, context=context)[0]
+        if data.action != 'exist':
+            data.write({'partner_id': None})
         self._convert_opportunity(cr, uid, ids, {'lead_ids': lead_ids}, context=context)
         self._merge_opportunity(cr, uid, ids, data.opportunity_ids, data.name, context=context)
         return lead.redirect_opportunity_view(cr, uid, lead_ids[0], context=context)