summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorFlorent Lejoly <fle@odoo.com>2019-09-17 13:57:34 +0000
committerThibault Delavallée <tde@odoo.com>2019-09-24 11:08:27 +0000
commit38d8b0526f0fccc32df5a11f5d086a3522ed5fcf (patch)
tree097fb88f1af68a89bc67e7aaf5633609ba2c0a1e /addons
parent119167622761bf92a659fb3e0986ba82bbd1c158 (diff)
[FIX] sale_crm: correctly handle customer option when converting opportunity
When converting an opportunity to a quotation, it will give 3 options where the last option is "Do not link to a customer". When clicked it has the same behavior than "Create a new customer". Followup of 1d2bccd0dbd2770e0625a26b66a8b48c954b2c86 that added the selection entry but did not implement its behavior. This commit fixes that behavior. Now it opens a quotation without linked customer. Task ID 2065014 closes odoo/odoo#37026 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/sale_crm/wizard/crm_opportunity_to_quotation.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/sale_crm/wizard/crm_opportunity_to_quotation.py b/addons/sale_crm/wizard/crm_opportunity_to_quotation.py
index 5bb95af10b7..de85076251f 100644
--- a/addons/sale_crm/wizard/crm_opportunity_to_quotation.py
+++ b/addons/sale_crm/wizard/crm_opportunity_to_quotation.py
@@ -32,10 +32,11 @@ class Opportunity2Quotation(models.TransientModel):
the freshly created opportunity view.
"""
self.ensure_one()
- self.lead_id.write({
- 'partner_id': self.partner_id.id if self.action == 'exist' else self._create_partner()
- })
- self.lead_id._onchange_partner_id()
+ if self.action != 'nothing':
+ self.lead_id.write({
+ 'partner_id': self.partner_id.id if self.action == 'exist' else self._create_partner()
+ })
+ self.lead_id._onchange_partner_id()
return self.lead_id.action_new_quotation()
def _create_partner(self):