Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0] pos_qr_scan #1431

Open
wants to merge 3 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions pos_qr_scan/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev

=========================
QR Code Scanning in POS
=========================

Scans QR codes via device's camera.

Usage
=====

To subscribe to scanning event use following code in js::

var core = require('web.core');
core.bus.on('qr_scanned', this, function(value){
// your handler here
})


Questions?
==========

To get an assistance on this module contact us by email :arrow_right: [email protected]

Contributors
============
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__


Further information
===================

Odoo Apps Store: https://apps.odoo.com/apps/modules/13.0/pos_qr_scan/


Tested on `Odoo 11.0 <https://github.com/odoo/odoo/commit/c7171795f891335e8a8b6d5a6b796c28cea77fea>`_
Empty file added pos_qr_scan/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions pos_qr_scan/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": """QR Code Scanning in POS""",
"summary": """Scans QR codes via device's camera""",
"category": "Point of Sale",
"images": ["images/main.png"],
"version": "14.0.1.0.2",
"application": False,
"author": "IT-Projects LLC, KolushovAlexandr",
"support": "[email protected]",
"website": "https://github.com/itpp-labs/pos-addons#readme",
"license": "Other OSI approved licence", # MIT
"depends": ["pos_qr_payments"],
"external_dependencies": {"python": [], "bin": []},
"data": ["views/assets.xml"],
"qweb": ["static/src/xml/templates.xml"],
"auto_install": False,
"installable": True,
}
14 changes: 14 additions & 0 deletions pos_qr_scan/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
`1.0.2`
-------

- **Fix:** - Scanner didn't work due to "ReferenceError: gCtx is not defined"

`1.0.1`
-------

- **FIX** - Error when showing error if webcam couldn't be started

`1.0.0`
-------

- Init version
45 changes: 45 additions & 0 deletions pos_qr_scan/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
=========================
QR Code Scanning in POS
=========================

Installation
============

* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way

Configuration
=============

Browser can get access to camera only on using via ``https`` connection.

Possible NGINX configurations to support ``https``::

server {
listen 443 ssl;
server_name posadd.odoo11.local;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

if ( $scheme = "http" )
{
rewrite ^/(.*)$ https://$host/$1 permanent;
}

proxy_buffers 16 64k;
proxy_buffer_size 128k;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 600s;
client_max_body_size 100m;

location /longpolling {
proxy_pass http://127.0.0.1:8072;
}

location / {
proxy_pass http://127.0.0.1:8069;
}
}
43 changes: 43 additions & 0 deletions pos_qr_scan/i18n/pos_qr_scan.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_qr_scan
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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: pos_qr_scan
#. openerp-web
#: code:addons/pos_qr_scan/static/src/xml/templates.xml:21
#, python-format
msgid "Cameras:"
msgstr ""

#. module: pos_qr_scan
#. openerp-web
#: code:addons/pos_qr_scan/static/src/xml/templates.xml:6
#, python-format
msgid "QR Scan"
msgstr ""

#. module: pos_qr_scan
#. openerp-web
#: code:addons/pos_qr_scan/static/src/xml/templates.xml:18
#, python-format
msgid "QR Scanning"
msgstr ""

#. module: pos_qr_scan
#. openerp-web
#: code:addons/pos_qr_scan/static/src/xml/templates.xml:26
#, python-format
msgid "Tap on the video to quit"
msgstr ""

Binary file added pos_qr_scan/images/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pos_qr_scan/static/description/button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pos_qr_scan/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
118 changes: 118 additions & 0 deletions pos_qr_scan/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan" style="color:#875A7B;">QR Code Scanning in POS</h2>
<h3 class="oe_slogan">Scans QR codes via device's camera.</h3>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<div class="oe_row_img oe_centered">
<img class="oe_demo oe_picture oe_screenshot" src="button.png"/>
</div>
</div>
<div class="oe_span6">
<h3 class="oe_mt32">
New Button to start scanning
</h3>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12 text-center">
<h3 class="oe_mt32">
Click <em>QR Scan</em> and make QR Code under camera as on the video below <em>(open it in a new Tab, if the video is not played)</em>.
Once QR is scanned, camera is closed and next action will be
done automatically
</h3>
</div>
<div class="oe_row_img oe_centered">
<video title="Open video in new Tab, if it's not played" style="width:100%; box-shadow: 5px 5px 10px 5px #888888;" loop autoplay controls>
<source src="scanning.webm" type="video/mp4">
<img class="oe_demo oe_picture oe_screenshot" src="button.png"/>
</video>
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">

<div class="alert alert-danger oe_mt32" style="padding:0.3em 0.6em; font-size: 150%;">
Result after scanning depends on other modules. For example, with module <a href="https://apps.odoo.com/apps/modules/13.0/pos_wechat/">WeChat Payments in POS</a> scanning will result registering qr-based payment.
</div>

</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">

<div class="alert alert-warning oe_mt32" style="padding:0.3em 0.6em; font-size: 150%;">
For mobile devices we recommend to use <a href="https://www.odoo.com/apps/modules/13.0/pos_mobile/">POS Mobile UI</a> module.
</div>

</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:[email protected]">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:[email protected]">[email protected] <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>[email protected] <i class="fa fa-skype"></i></li>
</ul>
</div>
<div class="oe_span4">
<div class="stamp" style="width:200px;">
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(4deg);
-o-transform: rotate(4deg);
-moz-transform: rotate(4deg);
-ms-transform: rotate(4deg);">
Tested on Odoo<br/>12.0 community
</div>
<!--<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(1deg);
-o-transform: rotate(1deg);
-moz-transform: rotate(1deg);
-ms-transform: rotate(1deg);">
Tested on Odoo<br/>12.0 enterprise
</div>-->
</div>
</div>
</div>
</section>
Binary file added pos_qr_scan/static/description/scanning.webm
Binary file not shown.
Loading