Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
3826 มุมมอง

How to get a specific field from a One2many relation ?

อวตาร
ละทิ้ง

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...

ผู้เขียน คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ย. 19
3264
2
เม.ย. 19
2940
2
ธ.ค. 22
21925
2
ก.พ. 20
4116
1
ส.ค. 19
4382