Skip to Content
Menu
This question has been flagged
1 Atsakyti
2603 Rodiniai

how to get last id for many2one in automated action

or whats the expression python write in value in this cas 

  

Portretas
Atmesti
Autorius
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')


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
vas. 25
5986
1
gruod. 24
1510
1
lapkr. 22
16083
3
rugp. 22
13153
2
rugp. 22
4582