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

restrict activate/archive Button to special group

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
4 Replies
10448 Tampilan
Avatar
Jack

how can i restrict the activate/archive Button (right top of the Products-Detail-Page) to a specifiv group?

i just could use xpath to make it invisible but i tried to set readonly to //button[@name='toggle_active'] and also //button[@name='toggle_active']  but it seems not to work.


any help?


0
Avatar
Buang
Avatar
Avinash Nk
Jawaban Terbai

Hi Jack,

You can add the group directly to a button.

Check this example code.

<button name="toggle_active" groups="base.group_no_one" type="object" class="oe_stat_button" icon="fa-archive">
    <field name="active" widget="boolean_button" options="{"terminology": "archive"}"/>
</button>

Here instead of groups="base.group_no_one" you can use your group.


Thanks

0
Avatar
Buang
Jack
Penulis

but how can i simply make it readonly for non authorized users? they should see that it is currently archived but they should not be able to reactivate it. the readonly attribute did not work for me

Avinash Nk

For fields, you can't make it readonly for some groups directly like doing for models. you can only hide them.

There are indirect ways. you can do this by inherit the write function and checking the condition as per your need.

Avatar
Ibrahim Boudmir
Jawaban Terbai

Hi, 

This is actually possible regardless of what Avinash says. The idea is to add the attribute disabled="true" to your button. 

In order to do that ( since it's based on conditions like the specific group ), you will need to follow these steps : 

1- Js : call the FormController and specifically function renderButtons.
2- The conditions you need to check are : your model because if not it these changes would apply on all toggle_active buttons. 
3- RPC call to check the user's groups in python side ( very simple solution ). The function call will return True is user has group ( to whom the button won't be 'clickable' )
4- in JS, if result, then :  point your button with a specific class in XML to be easily identified and then : $('.o-your-class-here').prop('disabled', true);
​

All these steps are a little bit complicated to put together. So even it's true to be possible, you may consider just Hiding the button with groups. It's much easier.

Upvote if this helps.
Regards.

1
Avatar
Buang
Avatar
Vasilis Zartilas
Jawaban Terbai

Inherited the 'active' field and add groups and specify which groups you want to have access to it.

(Note: For Action -> Archive)

For example:

from odoo import api, fields, models

class HrAppraisalInherited(models.Model):
   _inherit = "hr.appraisal"

   active = fields.Boolean(groups="hr.group_hr_manager")
0
Avatar
Buang
Avatar
fudo
Jawaban Terbai

Please try this:

https://www.linkedin.com/pulse/how-hide-archiveunarchive-dropdown-specific-users-groups-yadav/?trk=articles_directory

This need a bit of modify to work in odoo 15 and above, but it's the correct way

0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

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

Daftar
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