Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2557 Lượt xem

How to fetch one2many values in excel report  ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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)

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 22
2779
0
thg 7 21
2056
1
thg 4 23
11592
0
thg 11 22
2926
0
thg 9 21
2443