diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index fd5a753dc5dab..88f8c3a18c582 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -178,8 +178,8 @@ def process_email_queue(self, ids=None): ] if 'filters' in self._context: filters.extend(self._context['filters']) - # TODO: make limit configurable - filtered_ids = self.search(filters, limit=10000).ids + batch_size = int(self.env['ir.config_parameter'].sudo().get_param('mail.mail.queue.batch.size', 10000)) + filtered_ids = self.search(filters, limit=batch_size).ids if not ids: ids = filtered_ids else: