跳至内容
菜单
此问题已终结
1 回复
2623 查看

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
2月 25
5990
1
12月 24
1514
1
11月 22
16085
3
8月 22
13156
2
8月 22
4584