İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

What does odoo store in the one2many field ?

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
storeone2manydbodoo
4 Cevaplar
2362 Görünümler
Avatar
yahya sbini


Hi ,please I want know what is going on here !

in the sons field which is on father model (one to many) ,on sons are listed in the father record ,what does father record actually store (Sons IDs ?) ...if yes how does it stored ,is this field actually in DB dynamic array where I can ad as much sons as I want ?





0
Avatar
Vazgeç
yahya sbini
Üretici

Could any one help !

Avatar
D Enterprise
En İyi Yanıt

Hii,

No , the Father record does not directly store Son IDs in the database.

The relationship is stored on the Son model , where each Son has a foreign key (father_id) pointing back to the Father.

So:

  • Odoo's One2many field in the Father model just reads data from the Many2one field in the Son model.
  • This is not a dynamic array or list stored inside the Father row — it's a relational link across tables.

Technical Structure Behind It:

Father Model:

class Father(models.Model):

    _name = 'your.father.model'

    name = fields.Char()

    sons_ids = fields.One2many('your.son.model', 'father_id', string="Sons")


Latest Model:

class Son(models.Model):

    _name = 'your.son.model'

    name = fields.Char()

    father_id = fields.Many2one('your.father.model', string="Father")


What It Looks Like in the Database:

Table: your_father_model

ID name
1 Muhammad Sbini

Table: your_son_model:

ID name father_id
1 John 1
2 Nour 1

As you can see:

  • The father_id is stored in each Last record.
  • Odoo uses this to dynamically build the list (sons_ids) in the UI and ORM.

Is it a dynamic array?

No , it's not a real array or list in the DB.

It behaves like a list in the UI (like what you saw in your screenshot), but technically, it's just:

  • A set of son records
  • Each with a father_id equal to the current Father record

I hope it is of full use.

0
Avatar
Vazgeç
Avatar
Ruchita
En İyi Yanıt

In Odoo, a One2many field stores a list of related records (not just IDs). Specifically, it links records from another model that have a Many2one reference back to the current model.

Internally, Odoo doesn't store data directly in the One2many field in the database. Instead, it is computed based on the Many2one field in the related model. So technically, the One2many field is not stored in the current model's table — it just provides a reverse relation for easy access to child records.

Example:

If a Sale Order has a One2many field order_line (pointing to sale.order.line), then the actual data is stored in sale.order.line using a Many2one field like order_id that points back to the sale.order.

0
Avatar
Vazgeç
Avatar
Cybrosys Techno Solutions Pvt.Ltd
En İyi Yanıt

Hi,

You have a Father model with a field that lists sons, that's a One2many field in Odoo.

Example:

class Father(models.Model):
_name = 'my.father'

name = fields.Char(string='Father Name')
son_ids = fields.One2many('my.son', 'father_id', string="One of my sons")

class Son(models.Model):
_name = 'my.son'

name = fields.Char(string='Son Name')
father_id = fields.Many2one('my.father', string="Father")

The One2many field does NOT directly store data in the father model's database table. Instead, it works indirectly via the reverse Many2one field in the Son model. The father_id in the my.son table (DB) stores the link (foreign key).

One2many field (like the "sons" field on the father model) is a virtual relational field; it doesn't directly store any data in the father record's database table. Instead, the actual relationship is maintained through a Many2one field on the child model (in this case, each "son" record has a father_id field pointing to its parent "father"). So, when you see a list of sons under a father, Odoo is dynamically fetching all son records from the my.son table where father_id equals that father's ID. It’s not a stored list or array in the father's table; rather, it’s a reverse lookup based on the foreign key in the child model. This makes it scalable: you can add as many sons as you want, and Odoo will always pull them dynamically using a query, not by storing their IDs in the father record.


Hope it helps.

0
Avatar
Vazgeç
Avatar
Accurate | www.accurates.com.sa
En İyi Yanıt

Hi,

In Odoo, a one2many field (like 'sons' in your father model) doesn't actually store any data directly in the father record or table. Instead, the relationship is managed through the corresponding many2one field in the child model.

Here's what's happening:

  1. The father model has a one2many field pointing to sons: sons = fields.One2many('son.model', 'father_id', string="Sons")
  2. The son model has a many2one field pointing back to father: father_id = fields.Many2one('father.model', string="Father")
  3. In the database:
    • The father table doesn't have a column for sons
    • Each son record in the son table has a column called father_id that stores the ID of its parent

When you view a father record and see the list of sons, Odoo dynamically fetches all son records where father_id equals the current father's ID. This is done through a database query, not by accessing a stored array.

So to answer your questions directly:

  • No, the father record doesn't store sons' IDs
  • There is no array field in the database table
  • You can add as many sons as you want because each new son simply gets a new record in the son table with the appropriate father_id value

This design is a standard relational database pattern that allows for efficient storage and querying of one-to-many relationships without size limitations.

Regards,

Jishna

Accurates



0
Avatar
Vazgeç
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
how delete a Line in one2Many field ?
one2many odoo
Avatar
Avatar
Avatar
Avatar
3
Tem 25
23026
Insert values to one2many field on specific record of the partner
one2many odoo
Avatar
0
Eyl 23
144
Enable to select an entity on one2many list Çözüldü
one2many odoo
Avatar
Avatar
Avatar
2
Oca 24
17031
Domain on one2many field
one2many odoo
Avatar
Avatar
1
Nis 17
6620
Get active id value of One2many record which Clicked
one2many context odoo
Avatar
Avatar
1
Tem 25
2560
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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