[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
This commit is contained in:
XavierDo
2018-09-20 12:42:33 +02:00
parent f7957fb6aa
commit 932ac0e42a
+2 -1
View File
@@ -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,