Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

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

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
layoutstylethemethemes
1 Balas
6262 Tampilan
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
Buang
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
Jawaban Terbai

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
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How to change the layout (or backend theme) for Odoo Online?
layout theme themes
Avatar
Avatar
1
Des 22
4208
Creating a new Theme Odoo v16 Diselesaikan
theme themes odoo16features
Avatar
Avatar
Avatar
2
Mei 23
4275
I can't see web.planner progress bar after installing Backend theme (Odoo10 and 11)
theme themes web.planner
Avatar
0
Agu 21
4230
Creating custom theme for Odoo 14 Website Diselesaikan
theme website themes
Avatar
Avatar
Avatar
4
Okt 20
12264
Themes do not change colors of a website
theme website themes
Avatar
Avatar
1
Jun 20
5381
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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