Skip to content

Commit

Permalink
[MIG] event_registration_qr_code: Backport to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cvinh committed May 10, 2023
1 parent 4e3fdc9 commit bda3a0f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 49 deletions.
2 changes: 1 addition & 1 deletion event_registration_qr_code/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Event Registration QR Code",
"summary": "Automatically generate unique QR Codes for each registration",
"version": "15.0.1.0.0",
"version": "14.0.1.0.0",
"author": "Moka Tourisme, Odoo Community Association (OCA)",
"maintainers": ["ivantodorovich"],
"website": "https://github.com/OCA/event",
Expand Down
53 changes: 5 additions & 48 deletions event_registration_qr_code/reports/report_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,18 @@
<odoo>

<template
id="event_report_template_foldable_badge"
inherit_id="event.event_report_template_foldable_badge"
id="event_registration_report_template_badge"
inherit_id="event.event_registration_report_template_badge"
>
<xpath
expr="//div[hasclass('o_event_foldable_badge_barcode_container')]"
position="inside"
>
<xpath expr="//div[@id='o_event_name']/.." position="after">
<div class="col-12 text-center o_event_qr_code">
<t t-if="attendee">
<div class="mt-2">
<img
t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=0' % ('QR', attendee.qr_code, 96, 96)"
/>
t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=0' % ('QR', o.qr_code, 96, 96)"
/>
</div>
</t>
<t t-else="">
<h1 class="text-center mt-2">
<i
class="fa-2x fa fa-qrcode"
title="QR Code"
role="img"
aria-label="QR Code"
/>
</h1>
</t>
</div>
</xpath>
</template>

<template
id="event_report_template_full_page_ticket"
inherit_id="event.event_report_template_full_page_ticket"
>
<xpath
expr="//div[hasclass('o_event_full_page_ticket_barcode_container')]"
position="inside"
>
<t t-if="attendee">
<div class="mt-2">
<img
t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=0' % ('QR', attendee.qr_code, 64, 64)"
/>
</div>
</t>
<t t-else="">
<h1 class="text-center mt-2">
<i
class="fa-2x fa fa-qrcode"
title="QR Code"
role="img"
aria-label="QR Code"
/>
</h1>
</t>
</xpath>
</template>

</odoo>
6 changes: 6 additions & 0 deletions setup/event_registration_qr_code/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit bda3a0f

Please sign in to comment.