İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
2100 Görünümler

Hello folks,
i have quetion regarding recordset.

i have one2many field with 10 values i need to get last inserted record from the field 
how can we do that in odoo any help will be apreciated and thanks for your time.

Avatar
Vazgeç
En İyi Yanıt

self.'one2manyfield'[-1]

Avatar
Vazgeç
En İyi Yanıt

Hi,

Try this code:# Assuming 'order' is an instance of your model and 'order_line_ids' is a One2many or Many2many field
last_inserted_order_line = order.order_line_ids[-1]


Hope it helps

Avatar
Vazgeç
Üretici

it's work! thanks for your repely:)

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Tem 22
2240
0
Haz 22
2380
2
Eki 21
6391
3
May 23
3340
1
May 23
4200