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:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
2
Replies
2102
Tampilan
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:)
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
2
Jul 22
|
2241 | ||
|
0
Jun 22
|
2380 | ||
|
2
Okt 21
|
6392 | ||
|
3
Mei 23
|
3341 | ||
Group by on related field
Diselesaikan
|
|
1
Mei 23
|
4200 |