Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
2273 Vizualizări

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.

Imagine profil
Abandonează
Cel mai bun răspuns

self.'one2manyfield'[-1]

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

it's work! thanks for your repely:)

Related Posts Răspunsuri Vizualizări Activitate
2
iul. 22
2355
0
iun. 22
2461
2
oct. 21
6602
3
mai 23
3533
1
mai 23
4327