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

Filter a one2many field with a search view

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
filterone2manysearch_view
1 Balas
24195 Tampilan
Avatar
Jean-Claude Rieth

In a form view of a project.project model, I display related calendar.event records through a one2many field as a kanban

I'd like to filter that kanban view, but it doesn't work as described below.


On the form, I added the following field:

<field name="event_ids" mode="kanban"/>

The kanban shows up nicely on the form. Actually, a kanban view has been applied by default: the one that has the lowest sequence id.


As the system selected a kanban view, I assumed a search view is also applied by default.

The search view with the lowest sequence id is the following:

<record model="ir.ui.view" id="view_calendar_event_mysearch">

     <field name="name">calendar.event.mysearch</field>

     <field name="model">calendar.event</field>

     <field name="arch" type="xml">

        <search string="My search view">

            <field name="allday"/>

            <filter string="Full day events" name="filter_on_fullday" domain="[('allday','=',True)]"/>

         </search>

     </field>

</record>


If the search view would have been called from an action, I could have indicated a default filter in the act_window, like:

<field name="context">{'search_default_filter_on_fullday': 1}</field>


which made me think I could define a context on the field, like:

<field name="event_ids" mode="kanban" context="{'search_default_filter_on_fullday': 1}"/>


I must be missing something in my reasoning, because it doesn't work.

Maybe, no search view is selected by default. Can someone confirm?

How can I force a search view? And once a search view is applied, would it use the default filter?

If there is a search view, how can I tell the search view to execute the filter?

Thank you for your help.

1
Avatar
Buang
Niyas Raphy (Walnut Software Solutions)

https://www.odoo.com/forum/help-1/question/how-to-search-po-by-product-name-search-on-one2many-fields-31030

Avatar
Jean-Claude Rieth
Penulis Jawaban Terbai

Here is the solution.

In order to filter a one2many field on a form, the trick is to make a computed field, from the initial one2many field.

In my case, event_ids is the field I want to filter, in order to show only full day events.

In the model, I simply added a computed field, as follows:

    event_fullday_ids = fields.One2many('calendar.event', string='Full day events', compute='_get_event_fullday_ids')

And the function is:

    def _get_event_fullday_ids(self):
        self.event_fullday_ids = self.event_ids.search([('allday', '=', True)])

Then, instead of showing

<field name="event_ids" mode="kanban"/> on the form

I put this instead:

<field name="event_fullday_ids" mode="kanban"/>


3
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
All the items should be populated from drop down list and should be able to add/remove single, multiple or all the items as tags
filter search_view
Avatar
0
Des 15
3649
How can I add a search filter option for a one2many field on a form view in odoo9?
filter one2many search form_view search_view
Avatar
Avatar
1
Jul 19
11252
Filter One2many field in res.partner Diselesaikan
filter one2many odoo16features
Avatar
Avatar
1
Jan 24
2566
Filter one2many with dynamic values
filter one2many filters
Avatar
0
Jun 21
3282
Filter displayed data in one2many field
filter form one2many
Avatar
Avatar
Avatar
3
Sep 17
7840
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