[IMP] mail: take first found reminder activity type as default when creating reminders

If people define several reminders, take first found one based on sequence
as default activity type when creating reminders. This commit is linked to
the recent merge of reminders done at f488dc58c3.
This commit is contained in:
Thibault Delavallée
2018-03-27 14:59:51 +02:00
parent 60e5a887c5
commit 1905b8a5d5
+1 -1
View File
@@ -237,7 +237,7 @@ class MailController(http.Controller):
if date_deadline:
values['date_deadline'] = date_deadline
if not activity_type_id:
activity_type_id = request.env['mail.activity.type'].sudo().search([('category', '=', 'reminder')]).id
activity_type_id = request.env['mail.activity.type'].sudo().search([('category', '=', 'reminder')], limit=1).id
if activity_type_id:
values['activity_type_id'] = activity_type_id
activity = request.env['mail.activity'].create(values)