Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2624 Weergaven

how to get last id for many2one in automated action

or whats the expression python write in value in this cas 

  

Avatar
Annuleer
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.

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
feb. 25
5990
1
dec. 24
1514
1
nov. 22
16085
3
aug. 22
13156
2
aug. 22
4584