تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3474 أدوات العرض

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

الصورة الرمزية
إهمال
أفضل إجابة

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


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 23
3868
0
ديسمبر 22
4337
0
سبتمبر 24
1291
0
مايو 23
66
0
مارس 18
3435