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

How to fetch one2many values in excel report  ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

If you have a record set, lets say object, then you can access one2many field value using object.field_name, as it is one2many field, iterate the result over a for loop, to get the value from each lines.


UPDT:

row = col = 0

for line in obj.moce_raw_ids

    sheet.write(row, col, line.name, bold)
    row += 1

Thanks & Regards

อวตาร
ละทิ้ง
ผู้เขียน

sheet.write(0, 0, obj.move_raw_ids.product_id.name, bold)
i add it like that and i think it works, but i get this error
ValueError: Expected singleton: product.product(2, 3, 4)

ผู้เขียน

i this the error raised because i did't iterate using for loop,
but i'm wondering how to do it in excel report

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 22
2764
0
ก.ค. 21
2040
Creating Excel Reports แก้ไขแล้ว
1
เม.ย. 23
11533
0
พ.ย. 22
2879
0
ก.ย. 21
2427