Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2602 Tampilan

how to get last id for many2one in automated action

or whats the expression python write in value in this cas 

  

Avatar
Buang
Penulis
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.

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
2
Feb 25
5986
1
Des 24
1510
1
Nov 22
16083
3
Agu 22
13153
2
Agu 22
4582