コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2135 ビュー

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:)

関連投稿 返信 ビュー 活動
2
7月 22
2281
0
6月 22
2400
2
10月 21
6457
3
5月 23
3380
1
5月 23
4235