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
    • Discuss
    • 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

How to make two different listviews from the same model in a module?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
2 Replies
8028 Tampilan
Avatar
Yenthe Van Ginneken (Mainframe Monkey)

Hi everybody

I want to extend the project module and make a new menu item that shows the project.project data in a listview but with other fields.
The default project listview looks like this:
http://i.imgur.com/II0O8PW.png

I now want to create a second menu item that also shows a listview but with other field names. It should show me the name and some of my custom fields (such as x_internal_ip and x_external_ip).
How exactly should I do this? I've coded the second menu-item and the view but if I change the fields in the arch of project.project it reflects on both the project.project views that I now have.

My custom code:

<!--CUSTOM-->
    <record id="project_detail_tree" model="ir.ui.view">
            <field name="name">Details</field>
            <field name="model">project.project</field>
            <field name="arch" type="xml">
                <tree string="Details">
                    <field name="x_name"/>
            <field name="x_number"/>
            <field name="x_vm_name"/>
            <field name="x_internal_ip"/>
            <field name="x_external_ip"/>
            <field name="x_port"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="course_search_view">
            <field name="name">project.project.search</field>
            <field name="model">project.project</field>
            <field name="arch" type="xml">
                <search>
                    <field name="name"/>
                </search>
            </field>
        </record>

        <record model="ir.actions.act_window" id="project_course_action">
            <field name="name">Details overview</field>
            <field name="res_model">project.project</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        <field name="arch" type="xml">
                <search>
                    <field name="name"/>
                </search>
                </field>
        </record>

        <menuitem id="detail_menu" name="Details specifications" parent="base.menu_main_pm" />
        <menuitem id="project_details_menu" name="Details configuration" parent="detail_menu" action="project_course_action" />

The thing is that my code from project.project.tree is combined with the code of the default project.project tree code there is, which looks like this:

<record id="view_project" model="ir.ui.view">
            <field name="name">project.project.tree</field>
            <field name="model">project.project</field>
            <field name="field_parent">child_ids</field>
            <field name="arch" type="xml">
                <tree fonts="bold:message_unread==True" colors="red:date and (date&lt;current_date) and (state == 'open');blue:state in ('draft','pending');grey: state in ('close','cancelled')" string="Projects">
                    <field name="sequence" widget="handle"/>
                    <field name="message_unread" invisible="1"/>
                    <field name="date" invisible="1"/>
                    <field name="name" string="Project Name"/>
                    <field name="user_id" string="Project Manager"/>
                    <field name="partner_id" string="Contact"/>
                    <field name="parent_id" string="Parent" invisible="1"/>
                    <field name="planned_hours" widget="float_time"/>
                    <field name="total_hours" widget="float_time"/>
                    <field name="effective_hours" widget="float_time"/>
                    <field name="progress_rate" widget="progressbar"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>

What is the solution to make a second view with data from project.project in a second tree view?

Thanks
Yenthe

0
Avatar
Buang
Avatar
Bole
Jawaban Terbai

You can find good example for similar thing in account module.. 
Check account_invoice_view.xml.... 
there is invoice_form and invoice_supplier_form views both "sitting" on same model.. 
Trick is to define separate actions , and in them define wich view should they call.. 

Take a closer look and apply to your models :) 
I see you are quite experienced, so no need for noob-like step-by-step expanation.. 

also.. hope this will help you a bit : )

 

0
Avatar
Buang
Yenthe Van Ginneken (Mainframe Monkey)
Penulis

@Bole, thanks for the reply! Sadly I can't seem to find my error. I know it has to do with the view it should call and the correction references but I just can't find what I'm doing wrong! Care to take a look at it and give me a bit more guidance? Looks like I'm missing something vital here.

Avatar
Ivan
Jawaban Terbai

Yenthe, you need 2 actions in this case.  Within each action you can specify which views to use.  Bole has pointed out a good example file in ir.actions.act_window.view.  Search for "ir.actions.act_window.view" in that file for samples.

0
Avatar
Buang
Yenthe Van Ginneken (Mainframe Monkey)
Penulis

@John, thanks for the reply and some extra guidance! What I don't understand is why these two views interfere with eachother? I'm really missing the logic of this. Could you help me any further and give me a little sample or something? I'm really not sure about what to do. There are like three tree views in the sample too. :/

Ivan

Yenthe, when Odoo executes a window action that does not specify any specify view, it will search for a view of that model and the requested type (tree, form, etc.) based on the order of priority and name. So, the higher the priority (the smaller the number), the more chance it will be picked up if a view is requested without specifying which specific one. The same goes for the name order if you have multiple views with the same priority. I'm not too sure what is the behaviour if you have multiple valid views with the same priority and name.

Ivan

One more thing that you might have known before: trace the XML ids to see which view is used by which action.

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