İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

How to use groups policies in qweb templates?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
securityv8qwebgroups
1 Cevapla
18293 Görünümler
Avatar
Alejandro Santana

When extending a qweb template in v8, is it possible to add the groups policies to elements as in views*? How?
(*) Adding groups="my_module.my_security_group"

I have tried to hide the im_chat button at the top and show it only to some managers group, but it doesn't work as expected and has no result. The code:

<?xml version="1.0" encoding="UTF-8"?>

<templates xml:space="preserve">
<t t-extend="im_chat.ImTopButton">
    <t t-jquery="li" t-operation="replace">
        <li t-att-title='_t("Display Instant Messaging")' groups="my_module.group_my_module_manager">
            <a href="#">
                  <i id="oe_topbar_imbutton_icon" class="fa fa-comments-o"/>
            </a>
        </li>
    </t>
</t>
</templates>

I have also tried to specify the groups policy through t-field-options, with no luck.

<li t-att-title='_t("Display Instant Messaging")' t-field-options='{"groups": "crm_ticket_platforms.group_crm_ticket_platforms_manager"}'>

UPDATE:

Reading more, I have tried using tag "t-att-groups", as explained in official documentation (a-att-$name), but without result. As that expression is documented and supposed to work, I have opened an issue in Github: https://github.com/odoo/odoo/issues/5058 

Let's see how it ends.

 

UPDATE 2:

With some comments on issue https://github.com/odoo/odoo/issues/5058 it is clear I was missunderstanding the purpose of qweb t-att-$name attributes. It is intended for html attributes only (width, href, etc.), not for Odoo meta-data as group security policy.

It is stated I could use t-if, but haven't tested it yet. It surely uses some akward domain, as usual.

1
Avatar
Vazgeç
Avatar
Jérémy Kersten (jke)
En İyi Yanıt

Hello,

I'm not sure that  you can use groups in Qweb js.

Why not use the same code that in im_chat.js

    if (openerp.web && openerp.web.Model) {
        // Put the ImTopButton widget in the systray menu if the user is an employee
        var Users = new openerp.web.Model('res.users');
        Users.call('has_group', ['base.group_user']).done(function(is_employee) {
            if (is_employee) {
                openerp.web.SystrayItems.push(openerp.im_chat.ImTopButton);
            }
        });
    }

Good luck

2
Avatar
Vazgeç
Alejandro Santana
Üretici

Aaaaahhh... I just don't know a bit of javascript (yet). Is there any documentation on how to extend/override that in Odoo? I could change the group there, but I don't know how to use inheritance in Odoo js.

Jérémy Kersten (jke)

You can find a tuto here : https://www.odoo.com/documentation/8.0/howtos/web.html And Js documentation here : https://www.odoo.com/documentation/8.0/reference/javascript.html The simple way for you (not the more elegant way), will be to remove the button if not respected your conditions. The code from previous Answer is from master, take a look in im_chat from version 8.

Alejandro Santana
Üretici

I finally solved it as explained here: https://www.odoo.com/es_ES/forum/help-1/question/how-to-override-js-code-in-odoo-75335

Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Is it correct to define a group as base.group_name in custom modules?
security v8 groups
Avatar
0
May 16
5802
Get id of new Group Çözüldü
security v8 buttons groups
Avatar
Avatar
2
Tem 15
7290
How to override JS code in Odoo? Çözüldü
security v8 js groups
Avatar
Avatar
2
Mar 15
21739
QWEB: Place full width image on page Çözüldü
v8 qweb
Avatar
Avatar
1
Haz 21
8697
How to write not in group ?
qweb groups
Avatar
Avatar
1
Eki 18
6819
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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