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] qr_payments #1447

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
33 changes: 33 additions & 0 deletions qr_payments/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. image:: https://itpp.dev/images/infinity-readme.png
:alt: Tested and maintained by IT Projects Labs
:target: https://itpp.dev

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:target: https://opensource.org/licenses/MIT
:alt: License: MIT

===================
QR-based payments
===================

Technical module to support qr-based payments like Alipay, WeChat

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

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

Contributors
============
* `Ivan Yelizariev <https://it-projects.info/team/yelizariev>`__


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

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


Notifications on updates: `via Atom <https://github.com/it-projects-llc/pos-addons/commits/13.0/pos_qr_payments.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/pos-addons/commits/13.0/pos_qr_payments.atom>`_

Tested on `Odoo 11.0 <https://github.com/odoo/odoo/commit/4d0a1330e05bd688265bea14df4ad12838f9f2d7>`_
2 changes: 2 additions & 0 deletions qr_payments/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License MIT (https://opensource.org/licenses/MIT).
from . import tools
25 changes: 25 additions & 0 deletions qr_payments/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
{
"name": """QR-based payments""",
"summary": """Technical module to support qr-based payments like Alipay, WeChat""",
"category": "Hidden",
"images": ["images/QR-based payments.jpg"],
"version": "14.0.1.0.1",
"application": False,
"author": "IT-Projects LLC, Ivan Yelizariev",
"support": "[email protected]",
"website": "https://github.com/itpp-labs/pos-addons#readme",
"license": "Other OSI approved licence", # MIT
"depends": [],
"external_dependencies": {"python": [], "bin": []},
"data": [],
"demo": [],
"qweb": [],
"post_load": None,
"pre_init_hook": None,
"post_init_hook": None,
"uninstall_hook": None,
"auto_install": False,
"installable": True,
}
9 changes: 9 additions & 0 deletions qr_payments/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
`1.0.1`
-------

- **Fix:** invalid syntax error in python3.5+

`1.0.0`
-------

- **Init version**
5 changes: 5 additions & 0 deletions qr_payments/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
===================
QR-based payments
===================

The module cannot be used alone. Try to install, for example, `pos_wechat <https://apps.odoo.com/apps/modules/13.0/pos_wechat/>`__.
14 changes: 14 additions & 0 deletions qr_payments/i18n/qr_payments.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
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"

Binary file added qr_payments/images/QR-based payments.jpg
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 qr_payments/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.
61 changes: 61 additions & 0 deletions qr_payments/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan" style="color:#875A7B;">QR-based payments</h2>
<h3 class="oe_slogan">Technical module to support qr-based payments like Alipay, WeChat</h3>
</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(-7deg);
-o-transform: rotate(-7deg);
-moz-transform: rotate(-7deg);
-ms-transform: rotate(-7deg);">
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(0deg);
-o-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);">
Tested on Odoo<br/>12.0 enterprise
</div>-->
</div>
</div>
</div>
</section>
2 changes: 2 additions & 0 deletions qr_payments/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License MIT (https://opensource.org/licenses/MIT).
from .async_call import odoo_async_call
38 changes: 38 additions & 0 deletions qr_payments/tools/async_call.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
import threading

from odoo import api

__all__ = ["odoo_async_call"]


def odoo_async_call(target, args, kwargs, callback=None):
t = threading.Thread(target=odoo_wrapper, args=(target, args, kwargs, callback))
t.start()
return t


# TODO: is there more elegant way?
def odoo_wrapper(target, args, kwargs, callback):
self = get_self(target)
with api.Environment.manage(), self.pool.cursor() as cr:
result = call_with_new_cr(cr, target, args, kwargs)
if callback:
call_with_new_cr(cr, callback, (result,))


def get_self(method):
try:
# python 3
return method.__self__
except Exception:
# python 2
return method.im_self


def call_with_new_cr(cr, method, args=None, kwargs=None):
method_name = method.__name__
self = get_self(method)
self = self.with_env(self.env(cr=cr))
return getattr(self, method_name)(*(args or ()), **(kwargs or {}))
1 change: 1 addition & 0 deletions setup/qr_payments/odoo/addons/qr_payments
6 changes: 6 additions & 0 deletions setup/qr_payments/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,
)