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.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
2
回覆
2110
瀏覽次數
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
|
2246 | ||
|
0
6月 22
|
2381 | ||
|
2
10月 21
|
6421 | ||
|
3
5月 23
|
3343 | ||
|
1
5月 23
|
4200 |