Package: odoo11-addon-website-multi-theme
Website Multi ThemeAllow the website admin to set a different theme for each website.Thethememight be not just a theme-module, but any set of themes and even
particular views from any module (e.g. viewwebsite.custom_footerfromwebsitemodule). It also means, thatthemeis not just a styling, but
a content as well.It adds controls to make managing multiple websites easier:Drop-down list to switch to a different website.Change the related website of pages in the page properties dialog with checkboxes.Adds the fieldwebsite_idsto thewebsite.pagetree.How it worksCore idea is as followingFind views created bytheme-moduleand mark them asmulti-views(website.theme.asset) additionally to one specified manually via XML (seedemo/themes.xmlas an example). The method_convert_assetsis responsible for it.SetactivetoFalseformulti-views. See method_find_and_deactivate_views.ApplyMulti-theme(record in new modelwebsite.theme) to the specific
website. See method_multi_theme_activateMake some magic with technical viewswebsite.assets_frontendandwebsite.layout.Duplicatepatternsfromtemplates/patterns.xmlInlayout_patternreplace{theme_view}placeholder to a duplicate
ofassets_patternCorresponding duplicatedpatternwill be used as a new value forinherit_idfield in duplicatedmulti-viewsthat originally extendweb.assets_frontend,website.assets_frontendorwebsite.layout.Duplicatemulti-viewsof themulti-themeand itsdependencies(othermulti-themes). In duplicates, the fieldinherit_idis changed to other
duplicated views or duplicatedpatternswhen possibleInstallationTo make this module work, you need to either:Install any of the officially supported themes:theme_bootswatchInstall any of the unofficially supported themes (at your own risk):theme_anelusiatheme_artiststheme_avantgardetheme_beautytheme_bewisetheme_bistrotheme_bookstoretheme_cleantheme_enarktheme_graphenetheme_keatheme_loftspacetheme_mongoliatheme_nanotheme_notestheme_odoo_expertstheme_orchidtheme_treehousetheme_vehicletheme_yestheme_zapThemes in the above lists will become multiwebsite when installed along this
module.If they get installed after ``website_multi_theme``, update this
module manually, or it will not be notified of such change.ConfigurationTo configure this module, you need to:Go toWebsite Admin > Configuration > Settingsand choose or create
aWebsite.PressAdvanced > Multiwebsite theme > Reload.InAdvanced > Multiwebsite theme, pick one of the available themes.Via Edit button (fa-external-link) addDefault ThemetoSub-themesof
the selected theme to make multi-footer work.Once you save, any website that has noMultiwebsite themeselected will have,
the default plain Bootstrap theme, and those that do have one will get it.Of course, your Odoo instance must be reachable by all of the provided host
names, or nobody will ever see the effect. But that is most likely configured
through your DNS provider and/or proxy, so it is not a matter of this addon.If you want to test this behavior, think thatlocalhostand0.0.0.0are different host names.UsageTo use this module, you need to:Follow the configuration steps.Enter any of the websites you modified.Development FAQHow to develop a multiwebsite-ready theme?Checkdemo/themes.xml. It includes a demo theme that will serve as a
template for you. This demo theme turns primary buttons green, so you can test
if it is applied or not easily.How to convert a single-website theme in a multi-website one?Checkdata/themes_bootswatch.xml. You must do that. You can consider adding
the support directly in this addon, given it will just do nothing if the
single-website theme addon is not installed (it acts as a soft dependency).How to get multiwebsite-specific views updated?This addon is conservative by default, meaning that in production databases
views will not be updated if they already were created (except for the ones
copied fromtemplates/patterns.xml).To force your website getting updated views for all views from a base theme
that has changed, you should disable the website multi theme (to make the
engine remove all views) and then re-enable it again (to recreate them from
scratch).This does not happen in demo or development instances, where views arch is
always updated.How to test on runbot?Open[[ Website ]] >> Configuration >> SettingsSwitchWebsitefield fromWebsite localhosttoWebsite 0.0.0.0Clickfa-external-linkicon to edit the WebsiteAtWebsite Domainfield copy-paste build domain and add something right after the first dot, for example:Original domain: 3308093-10-0-28910f.runbot2.odoo-community.org
     New domain: 3308093-10-0-28910f.second-website.runbot2.odoo-community.orgClick[Save]to save changes at the WebsiteNow you can use unchanged build domain for website calledWebsite localhostand updated domain for website calledWebsite 0.0.0.0Known issues / RoadmapPrivate themes support is not guaranteed.There is no UI to remove websites. Do it through an odoo shell.Theme picker should include some kind of thumbnail if possible.If you install any of the supported themes after installing this addon, you
will have to pressReloadin the website config wizard to make it notice
the change.If you install any unsupported theme along with this addon, it would possibly
become the base for all those supported, which can easily lead to weird
situations and errors.CreditsContributorsRafael Blasco <rafael.blasco@tecnativa.com>Antonio Espinosa <antonio.espinosa@tecnativa.com>Jairo Llopis <jairo.llopis@tecnativa.com>Ivan Yelizariev <https://it-projects.info/team/yelizariev>Dennis Sluijk <d.sluijk@onestein.nl>MaintainerThis module is maintained by the OCA.OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.To contribute to this module, please visithttps://odoo-community.org.