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

many2many automaticly filled

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
wizardmany2many
1 Balas
14144 Tampilan
Avatar
Francisco Castro

Hi guys Help me I want to fill the many2many filled automaticly withou have to click on the add button

image description

I want fo fill the mannu "Lista de Pets" with the records on the "pets" when I click on the "Lista de Pets"

It is possible?

Show me an example please

0
Avatar
Buang
Avatar
René Schuster
Jawaban Terbai

If you just want to view a list of all the pets, I recommend a wizard (osv.osv_memory).

Anyway, wizard or not:
Add a default value for your many2many field and use a function to get all pets.

_columns = {
    'pet_ids' = fields.many2many(.....),
}

def _get_default_pet_ids(self, cr, uid, context=None):
    return self.pool.get('your_pet_module').search(cr, uid, [])

_defaults = {
    'pet_ids' = _get_default_pet_ids,
}

That's it.

EDIT:

The standard way to filter your data is using a search view.
But if you want to use a selection field do something like this:

def onchange_onwer_id(self, cr, uid, ids, val):
    ids = self.pool.get('your_pet_module').search(cr, uid, [('owner_id','=',val)])
    return {'value' : {'pet_ids' : ids}} 

_columns = {
    'pet_ids' = fields.many2many(.....),
    'owner_id' = fields.many2one(.......),
}

and in your .xml:

<field name="owner_id" on_change="onchange_owner_id(owner_id)"/>
6
Avatar
Buang
Francisco Castro
Penulis

thank you very much man. And if I want to put a selection filed to filter the records how can I do it?

Francisco Castro
Penulis

I have the 'owner_id' many2one filed I want to filter the pets by owner

Francisco Castro
Penulis

another question if u could help me... I want to put checkbox into the rows and when it are check load buttons to delete the records from the database. like in tree view when you check the checkbox, pops up a button and we can delete the records. I want the same and with the same button if its possible

René Schuster

I guess I don't know the answer to this question. Try removing the widget on your many to many field, or something. ^^

Francisco Castro
Penulis

ok thanks a lot you helped very much :)

Francisco Castro
Penulis

If I want to remove the 2 first rows on the many2many field by clicking on a button ("Remove") wich function I have to do? (btw you have to put here your email or skype eheh I have some questions and you help a lot)

Francisco Castro
Penulis

could you help me in another problem? hehe pls go to my question "many2many button action" if you know it pls explain me :)

Yenthe Van Ginneken (Mainframe Monkey)

Great sample :) It missed a : at the function so I corrected that. Thanks René

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
How to transfer id created wizard into main form?
wizard many2many
Avatar
Avatar
1
Jul 18
3976
Many2many field in wizard is showing empty (v9) ?
wizard many2many
Avatar
0
Jan 16
4117
Is it possible to use many2many relation for other many2many field in wizard
wizard many2many
Avatar
Avatar
1
Mar 15
5346
many2many in custom wizard
wizard many2many
Avatar
0
Mar 15
7965
Upon pressing save in a wizard, populate a many2many field
wizard many2many v15
Avatar
0
Jul 22
2959
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