From 1905b8a5d5b071076dfb7d71dc30f5c36b5d601b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 27 Mar 2018 13:42:18 +0200 Subject: [PATCH] [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 f488dc58c37fdc7fd49df759165de641e213444b. --- addons/mail/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py index 9682cbe1125..3445691f601 100644 --- a/addons/mail/controllers/main.py +++ b/addons/mail/controllers/main.py @@ -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)