我需要打印一份基本上从日历视图中发生的报告 . 问题是我无法根据日期对其进行分组(页面上特定日期的所有 Session 和另一个日期的 Session ) . 要打印的 Session 是基于我已经完成的日历之间的日期之间的日期 . 我可以打印一组日期范围的 Session ,但是按日期显示它是我想要实现的目标 .

以下是我的报告生成功能中的代码:

def _get_meeting(self, form):
    res=[]
    meetings=self.cr.execute("select * from calendar_event where allday != True and start_datetime between '" + str(form['from_date']) + "' and '" + str(form['to_date']) +"' order by start_datetime asc")
    meetings_view=self.cr.dictfetchall()
    meetings=[]
    for meeting in meetings_view:
        meeting_rec=self.pool.get('calendar.event').browse(self.cr, self.uid, meeting['id'])
        meetings.append(meeting_rec)           
    logging.error(meetings)  
    return meetings

以下是我的模板:

<template id="report_calendar_meeting_1">
<t t-call="report.external_layout">
    <div class="page">
        <div class="oe_structure"/>
        <div class="row" style="margin-bottom:80px;">
            <div class="col-xs-6">
            </div>
        </div>
        <h3>
            Meetings From: <span t-esc="data['form']['from_date']"/> to : <span t-esc="data['form']['to_date']"/>
        </h3>   
        <div class="row">
            <div class="col-xs-6">
            </div>
        </div>

    <table class="table table-condensed">
            <thead>
                <tr>
        <th>Name:</th>
        <th>Start Date</th>
                    <th>Responsible</th>
                    <th>Duration(Hours):</th>
                    <th>Description:</th>
                    <th>Location:</th>
                    <th>Attendees:</th>
                </tr>
             </thead>
     <tbody class="sale_tbody">
                <t t-foreach="get_meetings(data['form'])" t-as="doc">
        <tr>
        <td>
                        <span t-field="doc.name"/>
                    </td>
        <td>
                        <span t-field="doc.start_datetime"/>
                    </td>
        <td>
                        <span t-field="doc.user_id.name"/>
                    </td>
        <td>
                        <span t-field="doc.duration"/>
                    </td>
        <td>
                        <span t-field="doc.description"/>
                    </td>
        <td>
                        <span t-field="doc.location"/>
                    </td>
        <td>
                        <t t-foreach="doc.partner_ids" t-as="l">
                        <p t-field="l.name"/>
            </t>    
                    </td>
        </tr>
        </t>
    </tbody>
     </table>





        <div class="oe_structure"/>
     </div>
</t>

我需要能够打印一份报告,其中当天 Session 的日期显示在页面中 . 提前致谢!