Files
odoo_source/addons/website_event/models/website.py
T
Sébastien Mottet (oms) cd3ca50548 [IMP] website: change CTA based on website main objective
If user selects 'schedule appointments' as main objective in the configurator
and if the website_calendar module is installed then the Call To Action of
snippets s_banner, s_cover and s_call_to_action is changed to 'Schedule an
appointment' and redirect user to '/calendar' on click.

task-2518565

closes odoo/odoo#71162

Related: odoo/enterprise#18690
Related: odoo/design-themes#5
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-02 09:32:56 +00:00

22 lines
850 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, _
from odoo.addons.http_routing.models.ir_http import url_for
class Website(models.Model):
_inherit = "website"
def get_suggested_controllers(self):
suggested_controllers = super(Website, self).get_suggested_controllers()
suggested_controllers.append((_('Events'), url_for('/event'), 'website_event'))
return suggested_controllers
def get_cta_data(self, website_purpose, website_type):
cta_data = super(Website, self).get_cta_data(website_purpose, website_type)
if website_purpose == 'sell_more' and website_type == 'event':
cta_btn_text = _('Next Events')
return {'cta_btn_text': cta_btn_text, 'cta_btn_href': '/event'}
return cta_data