콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2299 화면

Hello folks,
i have quetion regarding recordset.

i have one2many field with 10 values i need to get last inserted record from the field 
how can we do that in odoo any help will be apreciated and thanks for your time.

아바타
취소
베스트 답변

self.'one2manyfield'[-1]

아바타
취소
베스트 답변

Hi,

Try this code:# Assuming 'order' is an instance of your model and 'order_line_ids' is a One2many or Many2many field
last_inserted_order_line = order.order_line_ids[-1]


Hope it helps

아바타
취소
작성자

it's work! thanks for your repely:)

관련 게시물 답글 화면 활동
2
7월 22
2358
0
6월 22
2484
2
10월 21
6630
3
5월 23
3556
1
5월 23
4338