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

Limit selections between two fields using Studio

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
4 Replies
1097 Tampilan
Avatar
Brandon Lackey

I'm trying to limit options shown in the Packages window.  I have two Many2One fields:

  • Carrier
  • Package Type

When I select a certain "Carrier" I only want to see the package types associated with that carrier.  For example "dhl" has (pack1, pack2, pack3), "fedex" has (pack4, pack5, pack6) and "usps" has (pack7, pack8, pack9).


I have figured out how to do this with a single carrier in the Domain of the "Package Type" field:

[["package_carrier_type","=","dhl"]]

However, I haven't figured out how to properly write the domain to work with all the carrier options.  Any help is greatly appreciated.

V16

0
Avatar
Buang
Avatar
Bob The Cow
Jawaban Terbai

Use this domain: [ '|',('carrier_id', '=', selected_carrier_id), ('carrier_id', '=', False)]

0
Avatar
Buang
Brandon Lackey
Penulis

Thank you for the input. Unfortunately, 'carrier_id' does not appear to be a valid domain entry in the Package Type field. Copying this code results in an "Domain not properly formed" error and I cannot find the 'carrier_id' when trying to add this manually in Studio with the Domain GUI.

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi Brandon,

To achieve dynamic filtering of the "Package Type" field based on the selected "Carrier" in Odoo v16, you can use a computed domain in your model definition. Here's how you can set it up:

Ensure that the Carrier model has a relational field in the Package Type model and apply a domain for the package_type Many2one field using Studio.

You can define the domain directly in the Studio interface like this:

[('carrier_id', '=', carrier_id)]

This domain will filter the available options in the "Package Type" field based on the selected "Carrier"


Hope it helps

0
Avatar
Buang
Brandon Lackey
Penulis

Thank you for the input! I haven't been able to get this to work yet, but I don't think I fully understand how to "Ensure that the Carrier model has a relational field in the Package Type model", could you provide a bit more detail on hot to accomplish this?

Avatar
Brandon Lackey
Penulis Jawaban Terbai

I have still been unable to get this to work.  Any help is greatly appreciated.

0
Avatar
Buang
Avatar
Master
Jawaban Terbai

Hi,

I'd be glad to help you with limiting package type options based on the selected carrier in Odoo V16. Here's the domain you can use for the "Package Type" field:

[ '|',('carrier_id', '=', selected_carrier_id), ('carrier_id', '=', False)]


Explanation:

  • [('carrier_id', '=', selected_carrier_id)]: This part filters the "Package Type" records where the carrier_id field is equal to the currently selected carrier's ID (selected_carrier_id). This ensures only package types associated with the chosen carrier are shown.
  • '|' (OR operator): This separates the two conditions within the domain.
  • ('carrier_id', '=', False)]: This part allows you to see package types that are not associated with any carrier (if applicable in your data model). This provides flexibility if you have some generic package types that can be used with any carrier.

Hope help you. ​

0
Avatar
Buang
Brandon Lackey
Penulis

Thanks for the info and explanation. Unfortunately, this doesn't seem to be working, I get the following error:
Unknown field "stock.package.type.carrier_id" in domain of <field name="package_type_id"> ([["carrier_id","=","selected_carrier_id"]]))

The "carrier_id" field appears to be a list of the Shipping Methods, but the fields available while creating the domain under the "package_carrier_type" are the base carriers selected as the "Provider" (delivery_type) within the Shipping method. I've tried using this modified code, but it's not working either (doesn't error, but the selection field stays empty):
[["package_carrier_type","=","selected_delivery_type"]]

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