Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Handyman
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivoustarvikkeet
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Tutoriaalit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

Can you apply a theme based on the user who logs in?

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
layoutstylethemethemes
1 Vastaa
6259 Näkymät
Avatar
Darrel

We want to let clients sign in to our system and each see only the menu items, pages, and layout/theme that we have made for that particular client.

I've been following the theme tutorial here (http://odoo-80.readthedocs.org/en/latest/guides/themes.html) but I don't see how to choose the theme based on the user viewing the page. I'm still pretty new to Odoo. Any ideas?

Edit: I'm also trying to figure out how to apply a theme to specific areas (controllers or actions) of the odoo site. Any links to documentation or tutorials on this would be appreciated.

0
Avatar
Hylkää
Luke Branch

@Darrel, I think you would need to build a custom theme and use a combination of t-if statements and group access rights to achieve what you require. Could you post back with details on exactly what you are trying to achieve with examples of what you'd like to achieve (eg. custom pages only viewable by certain user groups). This will make it easier for people to offer you advice on how you might be able to achieve your requirements.

OdooBot
sure, Luke.

I work for an ecommerce company, and we have two specific goals
requiring custom themes.

a) We want to let ecommerce clients log into Odoo and view reports on
our services, which are branded to that client. And b) We want
multiple separate layouts for the frontend website and product list,
based on the domain the website is being served from.

I think I can implement a new theme for the frontend, by having a
module with templates which inherit web.assets_backend,
website.assets_frontend and 'layout.' What I'm having trouble figuring
out is how (or if) I can make that CSS and HTML dependent on the user
viewing the page, for a, and the domain the site is being accessed
from, for b.

If it helps, we can ignore b) for now, since I am still quite new to
Odoo and the answer may become clear in time.

I would appreciate any help you can provide. There's still a lot I
don't understand about how the website module was able to create a
frontend and give it a separate layout like it has.

Darrel


On Thu, Dec 4, 2014 at 2:45 AM, Luke <luke-weairsoft-com@mail.odoo.com> wrote:
> @Darrel, I think you would need to build a custom theme and use a
> combination of t-if statements and group access rights to achieve what you
> require. Could you post back with details on exactly what you are trying to
> achieve with examples of what you'd like to achieve (eg. custom pages only
> viewable by certain user groups). This will make it easier for people to
> offer you advice on how you might be able to achieve your requirements.
>
> --
> Luke
> Sent by Odoo S.A. using Odoo about Forum Post Can you apply a theme based on
> the user who logs in?

>> I am trying to understand the mechanism behind how the website module
>> has a 'frontend' section which uses a different layout that the
>> regular admin area.

>> I thought I might see something in it's main.py controller class but
>> haven't found anything relevant yet.

>> For context, my two layout related goals are to a) apply a new layout
>> to a limited part of the website's frontend, and b) change that layout
>> depending on the user who is viewing the page (so, load a css file
>> specific to the user account).

>> Any tips, or links to documentation would be appreciated. I have gone
>> through this (http://odoo-80.readthedocs.org/en/latest/guides/themes.html)
>> but still don't see how to the actual areas covered by different
>> themes are controlled.
Avatar
Luke Branch
Paras vastaus

In regards to b) I believe what you are referring to is a multi-website type setup (similar to Magento's Website > Store > Store View architecture). Point b) is being worked on in version 9.0 (currently the master branch - runbot.odoo.com), however it is many months away from being released as a stable release. From what I understand version 9 will allow you to run multiple websites with different theme modules, different products, CMS pages, etc. from one database. Currently with Odoo 8.0 it is only really feasible to run one website with one set of CMS pages and products for the page.

While technically it is feasible to build some custom modules to achieve this type of functionality based on domain, etc. I think they would be hack methods/workarounds at best due to the fact the underlying architecture is not there to support it properly.

With that being said in regards to point a) you can certainly achieve what you want to do in regards to applying different user/user group access rights to certain CMS pages, reports, products, etc. by building your own module(s) to acheive the functionality.

I have achieved a few things with building a custom module to create some user-specific and user group specific functionality by liberally using the t-if and group access rights functionality in one of my custom theme modules that is being built for a client who sells airsoft products here:

http://www.aegguns.com

This website allows for distributor-only features by applying different variations on the following statement:

t-if="not user_id.partner_id.name == 'Public user'"

for example showing an add to cart button for logged in users only you could use the following snippet:
 

<template id="product_add_to_cart_Custom" inherit_id="website_sale.product" name="Add To Quote - Logged In" customize_show="True">

    <xpath expr="//a[@id='add_to_cart']" position="replace">

        <a t-if="not user_id.partner_id.name == 'Public user'" id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" href="#"><i class="fa fa-angle-double-right"></i>&amp;nbsp;&amp;nbsp;&amp;nbsp;Add to Quotation</a>

    </xpath>

</template>

In regards to group access rights, I believe there are a number of posts in this forum about them. Martin Apitz seems to be quite knowledgeable about this kind of thing. You can see his original answer to my question here regarding setting up distributor-only pricing on the website here:

https://www.odoo.com/forum/help-1/question/how-to-remove-pricing-for-not-logged-in-users-on-e-commerce-website-for-distributor-business-to-business-sales-52924

if you're interested in following the developments on Odoo 9.0 you can take a look at the runbots:

http://runbot.odoo.com/

take a look at the master branch (9.0 under development) and you can login to any of these instances by using username: admin, password: admin. If you'd like to take a look at what is being worked on for Website > Store > Store View type architecture in 9.0 you can take a look under Settings >> Website Settings > localhost (click on the dropdown box and create new). 

2
Avatar
Hylkää
Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
How to change the layout (or backend theme) for Odoo Online?
layout theme themes
Avatar
Avatar
1
jouluk. 22
4202
Creating a new Theme Odoo v16 Ratkaistu
theme themes odoo16features
Avatar
Avatar
Avatar
2
toukok. 23
4271
I can't see web.planner progress bar after installing Backend theme (Odoo10 and 11)
theme themes web.planner
Avatar
0
elok. 21
4226
Creating custom theme for Odoo 14 Website Ratkaistu
theme website themes
Avatar
Avatar
Avatar
4
lokak. 20
12260
Themes do not change colors of a website
theme website themes
Avatar
Avatar
1
kesäk. 20
5380
Yhteisö
  • Tutoriaalit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Tavaramerkki
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now