-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
18 changed files
with
780 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
========================== | ||
Event Registration QR Code | ||
========================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github | ||
:target: https://github.com/OCA/event/tree/15.0/event_registration_qr_code | ||
:alt: OCA/event | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/event-15-0/event-15-0-event_registration_qr_code | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/199/15.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Automatically generate QR Code for event registrations. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/event/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/event/issues/new?body=module:%20event_registration_qr_code%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Moka Tourisme | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Moka Tourisme <https://www.mokatourisme.fr>`_ | ||
|
||
* Iván Todorovich <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
.. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px | ||
:target: https://github.com/ivantodorovich | ||
:alt: ivantodorovich | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-ivantodorovich| | ||
|
||
This module is part of the `OCA/event <https://github.com/OCA/event/tree/15.0/event_registration_qr_code>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2022 Moka Tourisme (https://www.mokatourisme.fr). | ||
# @author Iván Todorovich <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Event Registration QR Code", | ||
"summary": "Automatically generate unique QR Codes for each registration", | ||
"version": "14.0.1.0.0", | ||
"author": "Moka Tourisme, Odoo Community Association (OCA)", | ||
"maintainers": ["ivantodorovich"], | ||
"website": "https://github.com/OCA/event", | ||
"license": "AGPL-3", | ||
"category": "Marketing", | ||
"depends": ["event"], | ||
"data": [ | ||
"views/event_registration.xml", | ||
"reports/report_templates.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * event_registration_qr_code | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2022-05-26 14:05+0000\n" | ||
"Last-Translator: jabelchi <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: ca\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.3.2\n" | ||
|
||
#. module: event_registration_qr_code | ||
#: model_terms:ir.ui.view,arch_db:event_registration_qr_code.event_report_template_foldable_badge | ||
#: model_terms:ir.ui.view,arch_db:event_registration_qr_code.event_report_template_full_page_ticket | ||
msgid "" | ||
"<i class=\"fa-2x fa fa-qrcode\" title=\"QR Code\" role=\"img\" aria-" | ||
"label=\"QR Code\"/>" | ||
msgstr "" | ||
"<i class=\"fa-2x fa fa-qrcode\" title=\"Codi QR\" role=\"img\" aria-label=" | ||
"\"Codi QR\"/>" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model,name:event_registration_qr_code.model_event_registration | ||
msgid "Event Registration" | ||
msgstr "Registre esdeveniment" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model.constraint,message:event_registration_qr_code.constraint_event_registration_qr_code_unique | ||
msgid "QR Code should be unique" | ||
msgstr "El codi QR ha d'ésser únic" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model.fields,field_description:event_registration_qr_code.field_event_registration__qr_code | ||
msgid "Qr Code" | ||
msgstr "Codi QR" |
37 changes: 37 additions & 0 deletions
37
event_registration_qr_code/i18n/event_registration_qr_code.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * event_registration_qr_code | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: event_registration_qr_code | ||
#: model_terms:ir.ui.view,arch_db:event_registration_qr_code.event_report_template_foldable_badge | ||
#: model_terms:ir.ui.view,arch_db:event_registration_qr_code.event_report_template_full_page_ticket | ||
msgid "" | ||
"<i class=\"fa-2x fa fa-qrcode\" title=\"QR Code\" role=\"img\" aria-" | ||
"label=\"QR Code\"/>" | ||
msgstr "" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model,name:event_registration_qr_code.model_event_registration | ||
msgid "Event Registration" | ||
msgstr "" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model.constraint,message:event_registration_qr_code.constraint_event_registration_qr_code_unique | ||
msgid "QR Code should be unique" | ||
msgstr "" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model.fields,field_description:event_registration_qr_code.field_event_registration__qr_code | ||
msgid "Qr Code" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * event_registration_qr_code | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2022-11-14 17:44+0000\n" | ||
"Last-Translator: Grégory Moka Tourisme <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: fr_FR\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n > 1;\n" | ||
"X-Generator: Weblate 4.14.1\n" | ||
|
||
#. module: event_registration_qr_code | ||
#: model_terms:ir.ui.view,arch_db:event_registration_qr_code.event_report_template_foldable_badge | ||
#: model_terms:ir.ui.view,arch_db:event_registration_qr_code.event_report_template_full_page_ticket | ||
msgid "" | ||
"<i class=\"fa-2x fa fa-qrcode\" title=\"QR Code\" role=\"img\" aria-" | ||
"label=\"QR Code\"/>" | ||
msgstr "" | ||
"<i class=\"fa-2x fa fa-qrcode\" title=\"QR Code\" role=\"img\" aria-label=" | ||
"\"QR Code\"/>" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model,name:event_registration_qr_code.model_event_registration | ||
msgid "Event Registration" | ||
msgstr "Inscription" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model.constraint,message:event_registration_qr_code.constraint_event_registration_qr_code_unique | ||
msgid "QR Code should be unique" | ||
msgstr "Le QR code doit être unique" | ||
|
||
#. module: event_registration_qr_code | ||
#: model:ir.model.fields,field_description:event_registration_qr_code.field_event_registration__qr_code | ||
msgid "Qr Code" | ||
msgstr "QR Code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import event_registration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2022 Moka Tourisme (https://www.mokatourisme.fr). | ||
# @author Iván Todorovich <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
import uuid | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class EventRegistration(models.Model): | ||
_inherit = "event.registration" | ||
|
||
qr_code = fields.Char( | ||
compute="_compute_qr_code", | ||
store=True, | ||
index=True, | ||
copy=False, | ||
) | ||
|
||
_sql_constraints = [ | ||
("qr_code_unique", "unique(qr_code)", "QR Code should be unique") | ||
] | ||
|
||
@api.depends("event_id") | ||
def _compute_qr_code(self): | ||
for rec in self: | ||
if not rec.qr_code: | ||
rec.qr_code = uuid.uuid4().hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* `Moka Tourisme <https://www.mokatourisme.fr>`_ | ||
|
||
* Iván Todorovich <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Automatically generate QR Code for event registrations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
|
||
<template | ||
id="event_registration_report_template_badge" | ||
inherit_id="event.event_registration_report_template_badge" | ||
> | ||
<xpath expr="//div[@id='o_event_name']/.." position="after"> | ||
<div class="col-12 text-center o_event_qr_code"> | ||
<div class="mt-2"> | ||
<img | ||
t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&humanreadable=0' % ('QR', o.qr_code, 96, 96)" | ||
/> | ||
</div> | ||
</div> | ||
</xpath> | ||
</template> | ||
|
||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.