[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 87e457158e and 42226de46e .

Community PR odoo/odoo#48946

closes odoo/odoo#48960

X-original-commit: de2e682824a636062fbb2c47b1bf5d7c7cef18db
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
Thibault Delavallée
2020-04-03 11:08:18 +00:00
parent c6c1080be1
commit 540df68b32
+1 -1
View File
@@ -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)