From e3405031ba9d0368a809a92981c8c6630dd79bdf Mon Sep 17 00:00:00 2001 From: "Audric Onockx (auon)" Date: Mon, 30 Aug 2021 09:00:11 +0000 Subject: [PATCH] [FIX] calendar : Fixed meeting accept page shoxs invalid logo Reproduce : - Login to the latest runbot 14.0 (BASE, not the main!) with the admin user - Install the apps "contacts" and "calendar". - Go to contacts and create a new contact with an email - Make a new company "Company B" and make sure that this is set as default company for the administrator user. - Set two different logo's on these companies so you can differentiate them. - Create a new meeting invitation and add the contact you created in step 2 to it. - Use the "Send mail" option on the meeting invite to make sure it gets sent. Then check in mailhog (it only comes in here after executing the queue cron for mails). - Now copy the link behind the "accept" button and copy it in an incognito. Result : The logo shown on the calendar invitation page is wrong as it uses the company logo from the company with ID 1 (first created company) while your logo in the email is the right one from your default company. Solution : The logo shown on the calendar invitation page is the one from the default company of the organizer if any, otherwise the one from the default company of the creator. opw-2579398 closes odoo/odoo#77907 X-original-commit: ffcaca15bd166d0dfe883a79e41a474b4a521d5a Signed-off-by: Arnaud Joset --- addons/calendar/controllers/main.py | 2 ++ addons/calendar/views/calendar_templates.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/calendar/controllers/main.py b/addons/calendar/controllers/main.py index 418cecaf5f5..47727becde3 100644 --- a/addons/calendar/controllers/main.py +++ b/addons/calendar/controllers/main.py @@ -64,6 +64,7 @@ class CalendarController(http.Controller): timezone = attendee.partner_id.tz lang = attendee.partner_id.lang or get_lang(request.env).code event = request.env['calendar.event'].with_context(tz=timezone, lang=lang).sudo().browse(int(id)) + company = event.user_id and event.user_id.company_id or event.create_uid.company_id # If user is internal and logged, redirect to form view of event # otherwise, display the simplifyed web page with event informations @@ -76,6 +77,7 @@ class CalendarController(http.Controller): # request.render()) response_content = request.env['ir.ui.view'].with_context(lang=lang)._render_template( 'calendar.invitation_page_anonymous', { + 'company': company, 'event': event, 'attendee': attendee, }) diff --git a/addons/calendar/views/calendar_templates.xml b/addons/calendar/views/calendar_templates.xml index 7bf940a5285..0f3e6d4e911 100644 --- a/addons/calendar/views/calendar_templates.xml +++ b/addons/calendar/views/calendar_templates.xml @@ -10,7 +10,7 @@