event/report/event_registration_report.xml

81 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="action_report_event_registration_attendee_list" model="ir.actions.report">
<field name="name">Attendee List</field>
<field name="model">event.registration</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">event.event_registration_attendee_list</field>
<field name="report_file">event.event_registration_attendee_list</field>
<field name="binding_model_id" ref="event.model_event_registration"/>
<field name="binding_type">report</field>
<field name="print_report_name">'Attendee List'</field>
</record>
</data>
<template id="attendee_list">
<h1>Attendee list</h1>
<div class="row">
<div class="col-7">
<div t-out="event.name"/>
</div>
<div class="col-5">
<span t-out="event.date_begin"/>
<i class="fa fa-arrow-right"/>
<span t-out="event.date_end"/>
</div>
</div>
<table class="table mt-3" style="page-break-after:always;">
<thead>
<tr class="text-start">
<th>Name</th>
<th>Company</th>
<th>Ticket type</th>
<th>Phone number</th>
<th></th>
</tr>
</thead>
<tbody>
<tr t-foreach="attendees" t-as="attendee">
<td><t t-out="attendee.name"/></td>
<td><t t-out="attendee.company_name"/></td>
<td><t t-out="attendee.event_ticket_id.name"/></td>
<td><t t-out="attendee.phone"/></td>
<td class="text-center">
<t t-if="attendee.barcode">
<img t-attf-src="/report/barcode/QR/{{ attendee.barcode }}?&amp;width=87&amp;height=87&amp;quiet=0" alt="QR Code"/>
</t>
</td>
</tr>
</tbody>
</table>
</template>
<template id="event_registration_attendee_list">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<t t-foreach="docs.grouped('event_id').items()" t-as="group">
<t t-call="event.attendee_list">
<t t-set="event" t-value="group[0].with_context(tz=group[0].date_tz)"/>
<t t-set="attendees" t-value="group[1]"/>
</t>
</t>
</t>
</t>
</template>
<template id="event_event_attendee_list">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<t t-foreach="docs" t-as="event">
<t t-call="event.attendee_list">
<t t-set="event" t-value="event.with_context(tz=event.date_tz)"/>
<t t-set="attendees" t-value="event.registration_ids"/>
</t>
</t>
</t>
</t>
</template>
</odoo>