Package: odoo10-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.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 createaWebsite.PressAdvanced > Multiwebsite theme > Reload.InAdvanced > Multiwebsite theme, pick one of the available themes.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 thatlocalhostand127.0.0.1are 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.Known 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.This addon will not work if your Odoo is not patched. Make sure it is updated
before installing. It must include these commits:https://github.com/odoo/odoo/commit/15bf41270d3abb607e7b623b59355594cad170cfhttps://github.com/odoo/odoo/commit/7c6714d7fee4125f037ef194f9cff5235a6c5320https://github.com/odoo/odoo/commit/48fe0a595308722a26afd5361432f24c610b4ba0CreditsContributorsRafael 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>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.