From 7703f1fb160b548130756e7e90bba093ab610158 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 25 May 2018 11:03:31 +0200 Subject: [PATCH] [FIX] mass_mailing: have unsubscribe in multi lang Since 953a693df link not corresponding to a route are tought multilang by default. Thus in the mass mailing, if the user had not the default language on the website he would have eg. a /fr_FR/unsubscribe_from_list placeholder in the mail. The placeholder is replaced by a real link pinpointing to the items the given person would unsubscribe to, but having /fr_FR/ part prevented that. With this PR, there is a dummy route so /unsubscribe_from_list is explicitely known as not multilang. opw-1850696 closes #24912 Co-authored-by: Goffin Simon --- addons/mass_mailing/controllers/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/mass_mailing/controllers/main.py b/addons/mass_mailing/controllers/main.py index ab902ee7d75..b642033b35c 100644 --- a/addons/mass_mailing/controllers/main.py +++ b/addons/mass_mailing/controllers/main.py @@ -11,6 +11,11 @@ from odoo.tools import consteq class MassMailController(http.Controller): + @http.route(['/unsubscribe_from_list'], type='http', website=True, multilang=False, auth='public') + def unsubscribe_placeholder_link(self, **post): + """Dummy route so placeholder is not prefixed by language, MUST have multilang=False""" + raise werkzeug.exceptions.NotFound() + @http.route(['/mail/mailing//unsubscribe'], type='http', website=True, auth='public') def mailing(self, mailing_id, email=None, res_id=None, token="", **post): mailing = request.env['mail.mass_mailing'].sudo().browse(mailing_id)