تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
2130 أدوات العرض

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
يوليو 22
2277
0
يونيو 22
2385
2
أكتوبر 21
6440
3
مايو 23
3365
1
مايو 23
4220