Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2617 Vues

how to get last id for many2one in automated action

or whats the expression python write in value in this cas 

  

Avatar
Ignorer
Auteur
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.

Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
2
févr. 25
5988
1
déc. 24
1512
1
nov. 22
16085
3
août 22
13154
2
août 22
4583