Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

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

Odebírat

Get notified when there's activity on this post

This question has been flagged
layoutstylethemethemes
1 Odpovědět
6297 Zobrazení
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
Zrušit
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
Nejlepší odpověď

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
Zrušit
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to change the layout (or backend theme) for Odoo Online?
layout theme themes
Avatar
Avatar
1
pro 22
4234
Creating a new Theme Odoo v16 Vyřešeno
theme themes odoo16features
Avatar
Avatar
Avatar
2
kvě 23
4313
I can't see web.planner progress bar after installing Backend theme (Odoo10 and 11)
theme themes web.planner
Avatar
0
srp 21
4253
Creating custom theme for Odoo 14 Website Vyřešeno
theme website themes
Avatar
Avatar
Avatar
4
říj 20
12358
Themes do not change colors of a website
theme website themes
Avatar
Avatar
1
čvn 20
5463
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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