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

[16.0][MIG] account_payment_terminal: Migration to 16.0 #567

Closed
108 changes: 108 additions & 0 deletions account_payment_terminal/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
========================
Account Payment Terminal
========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Faccount--payment-lightgray.png?logo=github
:target: https://github.com/OCA/account-payment/tree/14.0/account_payment_terminal
:alt: OCA/account-payment
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-payment-14-0/account-payment-14-0-account_payment_terminal
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/96/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This addon allows to pay invoices using a payment terminal. It communicates with the payment terminal proxy using the same protocol as OCA `pos_payment_terminal`.

**Table of contents**

.. contents::
:local:

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

To configure a bank journal as allowed to use payment terminals:

#. Go to the menu Invoicing > Configuration > Journals.
#. Select or create a new bank journal.
#. Set the field 'Use a Payment Terminal' to your terminal type.

Now you should create the payment terminals:

#. Go to the menu Invoicing > Configuration > Payment terminals.
#. Create a new terminal by setting:
#. The hostname or ip address of the hardware proxy.
#. The identifier of the terminal as known by the hardware proxy (Leave empty if the proxy has only one terminal connected).

Usage
=====

#. Go to Invoicing > Customers > Invoices and select an open invoice.
#. Register a payment.
#. Select the bank journal configured to use payment terminals.
#. Select a terminal.
#. Confirm.

You can test the flow using the mock terminal of `pywebdriver project <https://github.com/akretion/pywebdriver>`_ (an alternative to the POSbox/IoTbox).

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-payment/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/account-payment/issues/new?body=module:%20account_payment_terminal%0Aversion:%2014.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
~~~~~~~

* ACSONE SA/NV

Contributors
~~~~~~~~~~~~

* Souheil Bejaoui <souheil.bejaoui@acsone.eu>

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-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
:target: https://github.com/sbejaoui
:alt: sbejaoui

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sbejaoui|

This module is part of the `OCA/account-payment <https://github.com/OCA/account-payment/tree/14.0/account_payment_terminal>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions account_payment_terminal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
28 changes: 28 additions & 0 deletions account_payment_terminal/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Payment Terminal",
"summary": """This addon allows to pay invoices using payment terminal""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"maintainers": ["sbejaoui"],
"website": "https://github.com/OCA/account-payment",
"depends": ["account"],
"data": [
"security/account_payment_terminal.xml",
"views/account_payment_terminal_views.xml",
"views/account_journal_views.xml",
"views/oca_payment_terminal_form_mixin.xml",
"wizards/account_payment_register.xml",
],
"assets": {
"web.assets_backend": [
"account_payment_terminal/static/src/js/views/"
"payment_terminal_form/payment_terminal_form_controller.js",
"account_payment_terminal/static/src/js/views/"
"payment_terminal_form/payment_terminal_form_view.js",
],
},
}
210 changes: 210 additions & 0 deletions account_payment_terminal/i18n/account_payment_terminal.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_payment_terminal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: account_payment_terminal
#: model:ir.model,name:account_payment_terminal.model_account_payment_terminal
msgid "Account Payment Terminal"
msgstr ""

#. module: account_payment_terminal
#: model_terms:ir.ui.view,arch_db:account_payment_terminal.account_payment_register_form_view
msgid "Create Payment"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__create_uid
msgid "Created by"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__create_date
msgid "Created on"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_journal__display_name
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_register__display_name
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__display_name
#: model:ir.model.fields,field_description:account_payment_terminal.field_oca_payment_terminal_form_mixin__display_name
msgid "Display Name"
msgstr ""

#. module: account_payment_terminal
#. openerp-web
#: code:addons/account_payment_terminal/static/src/js/views/payment_terminal_form/payment_terminal_form_controller.js:0
#, python-format
msgid "Error querying terminal driver status"
msgstr ""

#. module: account_payment_terminal
#. openerp-web
#: code:addons/account_payment_terminal/static/src/js/views/payment_terminal_form/payment_terminal_form_controller.js:0
#, python-format
msgid "Error starting payment transaction"
msgstr ""

#. module: account_payment_terminal
#. openerp-web
#: code:addons/account_payment_terminal/static/src/js/views/payment_terminal_form/payment_terminal_form_controller.js:0
#, python-format
msgid ""
"Failed to send the amount to pay to the payment terminal. Press the red "
"button on the payment terminal and try again."
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_journal__id
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_register__id
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__id
#: model:ir.model.fields,field_description:account_payment_terminal.field_oca_payment_terminal_form_mixin__id
msgid "ID"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__proxy_ip
msgid "IP Address"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model,name:account_payment_terminal.model_account_journal
msgid "Journal"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_journal____last_update
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_register____last_update
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal____last_update
#: model:ir.model.fields,field_description:account_payment_terminal.field_oca_payment_terminal_form_mixin____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__write_uid
msgid "Last Updated by"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__write_date
msgid "Last Updated on"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__name
msgid "Name"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_register__need_payment_terminal
msgid "Need Payment Terminal"
msgstr ""

#. module: account_payment_terminal
#: code:addons/account_payment_terminal/models/account_journal.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model,name:account_payment_terminal.model_oca_payment_terminal_form_mixin
msgid "OCA Payment Terminal Form Mixin"
msgstr ""

#. module: account_payment_terminal
#. openerp-web
#: code:addons/account_payment_terminal/static/src/js/views/payment_terminal_form/payment_terminal_form_controller.js:0
#, python-format
msgid "Payment Successful"
msgstr ""

#. module: account_payment_terminal
#. openerp-web
#: code:addons/account_payment_terminal/static/src/js/views/payment_terminal_form/payment_terminal_form_controller.js:0
#, python-format
msgid "Payment Successful but couldn't confirm it in odoo"
msgstr ""

#. module: account_payment_terminal
#: code:addons/account_payment_terminal/models/oca_payment_terminal_form_mixin.py:0
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_register__account_payment_terminal_id
#: model:ir.model.fields,field_description:account_payment_terminal.field_oca_payment_terminal_form_mixin__account_payment_terminal_id
#, python-format
msgid "Payment Terminal"
msgstr ""

#. module: account_payment_terminal
#. openerp-web
#: code:addons/account_payment_terminal/static/src/js/views/payment_terminal_form/payment_terminal_form_view.js:0
#, python-format
msgid "Payment Terminal Form"
msgstr ""

#. module: account_payment_terminal
#: model:ir.actions.act_window,name:account_payment_terminal.account_payment_terminal_act_window
#: model:ir.ui.menu,name:account_payment_terminal.account_payment_terminal_menu
msgid "Payment Terminals"
msgstr ""

#. module: account_payment_terminal
#: code:addons/account_payment_terminal/models/oca_payment_terminal_form_mixin.py:0
#, python-format
msgid ""
"Payment terminal is not correctly configured. Please contact your "
"administrator."
msgstr ""

#. module: account_payment_terminal
#: model_terms:ir.ui.view,arch_db:account_payment_terminal.account_payment_register_payment_terminal_form_view
#: model_terms:ir.ui.view,arch_db:account_payment_terminal.oca_payment_terminal_form_mixin_form_view
msgid "Please check the payment terminal"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,help:account_payment_terminal.field_account_journal__use_payment_terminal
msgid "Record payments with a terminal on this journal."
msgstr ""

#. module: account_payment_terminal
#: model:ir.model,name:account_payment_terminal.model_account_payment_register
msgid "Register Payment"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_payment_terminal__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,help:account_payment_terminal.field_account_payment_terminal__proxy_ip
msgid "The hostname or ip address of the hardware proxy"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,help:account_payment_terminal.field_account_payment_terminal__oca_payment_terminal_id
msgid ""
"The identifier of the terminal as known by the hardware proxy. Leave empty "
"if the proxy has only one terminal connected."
msgstr ""

#. module: account_payment_terminal
#. openerp-web
#: code:addons/account_payment_terminal/static/src/js/views/payment_terminal_form/payment_terminal_form_controller.js:0
#, python-format
msgid "Transaction cancelled"
msgstr ""

#. module: account_payment_terminal
#: model:ir.model.fields,field_description:account_payment_terminal.field_account_journal__use_payment_terminal
msgid "Use a Payment Terminal"
msgstr ""
3 changes: 3 additions & 0 deletions account_payment_terminal/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import account_journal
from . import account_payment_terminal
from . import oca_payment_terminal_form_mixin
18 changes: 18 additions & 0 deletions account_payment_terminal/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2021 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, fields, models


class AccountJournal(models.Model):

_inherit = "account.journal"

use_payment_terminal = fields.Selection(
selection=lambda self: self._get_payment_terminal_selection(),
string="Use a Payment Terminal",
help="Record payments with a terminal on this journal.",
)

def _get_payment_terminal_selection(self):
return [("oca_payment_terminal", _("OCA Payment Terminal"))]
Loading