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

Hi, I've made a custom module with two models and I've then installed the Base Report app (report_xlsx module) from OCA and I've made a report for one of the models. If done in this way, the report works: I select the records of the model that I want to see in the file and then select print, and the file xlsx shows up correctly.

What I would like to do now is to export in the same report file all the records of the other model: how could I do it?

Thanks

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

you can use self.env['other.model'].search()

and add it in a list.

just like
your_list = []
for x in self.env['other.model'].search([your_condition_here])
vals = {

}
your_list.append(vals)

and then add your_list in your context


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 23
4038
0
thg 12 22
4515
0
thg 9 24
1450
0
thg 5 23
66
0
thg 3 18
3563