Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2109 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

self.'one2manyfield'[-1]

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

it's work! thanks for your repely:)

Powiązane posty Odpowiedzi Widoki Czynność
2
lip 22
2245
0
cze 22
2381
2
paź 21
6421
3
maj 23
3342
1
maj 23
4200