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

Hide/Show Menu Items Based On Groups - Odoo 11

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
developmentpythonxmlmenuitem
7486 Tampilan
Avatar
Andrew Crotwell

Hello, 

I have been asking quite a few questions about menu items. Hopefully this will be the last. I am now configuring my custom modules settings page. I would like to make it that certain menu items show/hide depending on a boolean. 

Lets use odoo's source code as an example as i have nothing written, everything i did just had errors. I'm just trying to understand what's going on before i begin to program. Everything below is from odoo 11 MRP. 

res_config_settings.py:

    group_mrp_routings = fields.Boolean("Work Orders & Quality",
        implied_group='mrp.group_mrp_routings')
@api.onchange('group_mrp_routings')
    def _onchange_group_mrp_routings(self):
        self.module_quality_mrp = self.group_mrp_routings

Okay ^^ declaring the boolean, got it. Whats implied group? And whats the onchange doing here? 

mrp_workcenter_views.xml:

<menuitem id="menu_mrp_dashboard"
            name="Dashboard"
            action="mrp_workcenter_kanban_action"
            groups="group_mrp_routings"
            parent="menu_mrp_root"
            sequence="5"/>

Basic menu item with group in it. This is where my error would come in. It would always say key id error, groups id doesn't exist...even though we declared it in the python file?

res_config_settings.xml:

<div class="col-md-6 col-xs-12 o_setting_box" id="work_order" title="Work Order Operations allow you to create and manage the manufacturing operations that should be followed within your work centers in order to produce a product. They are attached to bills of materials that will define the required raw materials.">
                                <div class="o_setting_left_pane">
                                    <field name="group_mrp_routings"/>
                                    <field name="module_quality_mrp" invisible="1"/>
                                </div>
                                <div class="o_setting_right_pane">
                                    <label for="group_mrp_routings"/>
                                    <div class="text-muted">
                                        Process operations at specific work centers based on the routing
                                        and carry out quality checks.
                                    </div>
                                    <div class="content-group" attrs="{'invisible': [('group_mrp_routings','=',False)]}">
                                        <div class="mt16">
                                            <div>
                                                <button name="%(mrp.mrp_routing_action)d" icon="fa-arrow-right" type="action"  string="Routings" class="btn-link"/>
                                            </div>
                                            <div>
                                                <button name="%(mrp.mrp_workcenter_action)d" icon="fa-arrow-right" type="action" string="Work Centers" class="btn-link"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

Okay, settings the label and group to the boolean we declared earlier. Seems simple enough. My module is for agriculture. I have a menu item titled "additives" for which farmers can choose to monitor additive usage. I made a boolean with the implied group, i made the menu item with the same group, i made the settings display said boolean. It would give me id key error every single time, specifically on the menuitem. What am i missing?

0
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
TypeError str and datetime Diselesaikan
development python
Avatar
Avatar
Avatar
2
Agu 24
2319
Group by on related field Diselesaikan
development python xml odoo v15
Avatar
Avatar
1
Mei 23
4917
How to hide view.xml fields group in Account module with attr
python xml
Avatar
Avatar
Avatar
2
Des 23
13945
how to remove first empty element from fields.selection Diselesaikan
python xml
Avatar
Avatar
Avatar
3
Jul 22
24356
How to Date deduction with Python ?
python xml
Avatar
Avatar
2
Jun 21
19468
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