Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
3673 Weergaven

How to get a specific field from a One2many relation ?

Avatar
Annuleer

you mean the specific fields value from one2many?

Hi,

if your O2M is fields_ids for example then your need to loop in order to get the field you want field_1:

I suppose you want to get value of a field that exists in O2M's model.

for my_field in self.field_ids:

print("field_1 Value for my_field is: %s") % my_field.field_1

Odoo Development Tips: https://old.reddit.com/r/learnopenerp/

Hope this will helps u in future...

Auteur Beste antwoord

i have 2 calss student and option, there is a field in student who is called option_ids many2many with the class option, in another view i have a selection of student, when i choose a student i want to display all his option in other field

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
nov. 19
3112
2
apr. 19
2788
2
dec. 22
21597
2
feb. 20
3947
1
aug. 19
4215