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

how to get last id for many2one in automated action

or whats the expression python write in value in this cas 

  

الصورة الرمزية
إهمال
الكاتب
How to write this code like picture to get last id 

Le mer. 30 juin 2021 à 05:09, Sudhir Arya (ERP Harbor Consulting Services) <sudhir22.arya@gmail.com> a écrit :

A new answer on get last id for many2one in automated action has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

أفضل إجابة

You can use order='id desc' parameter in the search method to get the last record.

Ex:

self.env['res.partner'].search([], limit=1, order='id desc')


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
فبراير 25
5988
1
ديسمبر 24
1512
1
نوفمبر 22
16085
3
أغسطس 22
13154
2
أغسطس 22
4583