From 932ac0e42a4f87919eb0bc97849e034fd6bfcf8f Mon Sep 17 00:00:00 2001 From: XavierDo Date: Thu, 20 Sep 2018 11:52:00 +0200 Subject: [PATCH] [FIX] mail: clean context before default activity creation When trying to mark an activity as done & launch next from the crm kanban view, an default_type "opportunity" was present in the context, and kept untill trying to create a voip phonecall if the default next activity type had a category "Phonecall". Removing the default from the context in this case will avoid this kind of error. PR: #27128 --- addons/mail/models/mail_activity.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/models/mail_activity.py b/addons/mail/models/mail_activity.py index bdf9546e72b..f96a8bce8d1 100644 --- a/addons/mail/models/mail_activity.py +++ b/addons/mail/models/mail_activity.py @@ -10,6 +10,7 @@ import pytz from odoo import api, exceptions, fields, models, _ from odoo.tools import pycompat +from odoo.tools.misc import clean_context _logger = logging.getLogger(__name__) @@ -374,7 +375,7 @@ class MailActivity(models.Model): @api.multi def action_feedback_schedule_next(self, feedback=False): ctx = dict( - self.env.context, + clean_context(self.env.context), default_previous_activity_type_id=self.activity_type_id.id, activity_previous_deadline=self.date_deadline, default_res_id=self.res_id,