Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
2131 Переглядів

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.

Аватар
Відмінити
Найкраща відповідь

self.'one2manyfield'[-1]

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Автор

it's work! thanks for your repely:)

Related Posts Відповіді Переглядів Дія
2
лип. 22
2279
0
черв. 22
2394
2
жовт. 21
6446
3
трав. 23
3375
1
трав. 23
4223