From 540df68b325d775fdccfe69d82cbb01a39b3a680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 28 Feb 2020 13:07:28 +0000 Subject: [PATCH] [FIX] crm: do not erase activity_type_id field value when converting activity_type_id is a related field on the first activity to do and should probably not be reset / forced to a value. It is probably some code coming from previous implementations of activities that were linked to crm only. Coming notably from 87e457158e83295a17761a1ea0d251ba87472596 and 42226de46ea0cb2ff93f8e34af323fb1d805fce0 . Community PR odoo/odoo#48946 closes odoo/odoo#48960 X-original-commit: de2e682824a636062fbb2c47b1bf5d7c7cef18db Signed-off-by: Thibault Delavallee (tde) --- addons/crm/wizard/crm_lead_to_opportunity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index 2d7b8b77489..e56dd0583d0 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -126,7 +126,7 @@ class Lead2OpportunityPartner(models.TransientModel): to_merge = self.duplicated_lead_ids result_opportunity = to_merge.merge_opportunity(auto_unlink=False) if not result_opportunity.active: - result_opportunity.write({'active': True, 'activity_type_id': False, 'lost_reason': False}) + result_opportunity.write({'active': True, 'lost_reason': False}) if result_opportunity.type == "lead": self._convert_and_allocate(result_opportunity, [self.user_id.id], team_id=self.team_id.id)