Skip to Content
Menu
This question has been flagged
1 Reply
1936 Views

how to get last id for many2one in automated action

or whats the expression python write in value in this cas 

  

Avatar
Discard
Author
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.

Best Answer

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


Avatar
Discard
Related Posts Replies Views Activity
1
Nov 22
14645
3
Aug 22
10751
2
Aug 22
3045
0
Jul 22
835
2
Oct 21
1434