Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,46 @@
# POS Payment Terminal
Odoo addon: pos_payment_terminal
## Installation
```bash
pip install odoo-bringout-oca-pos-pos_payment_terminal
```
## Dependencies
This addon depends on:
- point_of_sale
## Manifest Information
- **Name**: POS Payment Terminal
- **Version**: 16.0.1.0.3
- **Category**: Point Of Sale
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/pos](https://github.com/OCA/pos) branch 16.0, addon `pos_payment_terminal`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Pos_payment_terminal Module - pos_payment_terminal
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for pos_payment_terminal. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [point_of_sale](../../odoo-bringout-oca-ocb-point_of_sale)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon pos_payment_terminal or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-pos-pos_payment_terminal"
# or
uv pip install odoo-bringout-oca-pos-pos_payment_terminal"
```

View file

@ -0,0 +1,13 @@
# Models
Detected core models and extensions in pos_payment_terminal.
```mermaid
classDiagram
class pos_payment_method
class pos_session
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: pos_payment_terminal. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon pos_payment_terminal
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,8 @@
# Security
This module does not define custom security rules or access controls beyond Odoo defaults.
Default Odoo security applies:
- Base user access through standard groups
- Model access inherited from dependencies
- No custom row-level security rules

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon pos_payment_terminal
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,109 @@
====================
POS Payment Terminal
====================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:90c98f4f7f6b65736ec4de9619ac22856ba9e32c5c63cb5444c4b63c381bab13
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/16.0/pos_payment_terminal
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_payment_terminal
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module adds support for credit card reader and checks printer
in the Point of Sale.
**Table of contents**
.. contents::
:local:
Installation
============
This module is designed to be installed on the
*main Odoo server*. On the *POSbox/IoTbox*, you should install the module
*hw_x* depending on the protocol implemented in your device. Remember that the POSbox/IoTbox runs Odoo v12 (even if your Odoo server runs v13 or v14), so you should look in the 12.0 branch of the `OCA POS project <https://github.com/OCA/pos>`_ to find the *hw_x* modules.
`Ingenico <http://en.wikipedia.org/wiki/Ingenico>`
card readers for France support the Telium protocol implemented in the
*hw_telium_payment_terminal* module for the POSbox/IoTBox.
You can also consider `pywebdriver project <https://github.com/akretion/pywebdriver>`_ as an alternative to the POSbox/IoTbox.
Configuration
=============
* Go to *Point of Sale > Configuration > Payment Methods*, edit the
payment method corresponding to the card reader and set
the field *Use a payment terminal* to *OCA Payment Terminal*. A new field *Payment Mode* will appear, that has *Card* as defaut value. If the payment method is for Checks and you have a check printer, select *Check* instead.
.. figure:: https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_terminal/static/description/pos_payment_method_form.png
Usage
=====
In the frontend of the POS, when you select a payment method that has a payment mode with *Use a Payment Terminal* set to *OCA Payment Terminal*, you will have an additionnal *Send* button: if you click on that button, the amount, the currency and the payment mode will be sent to the POSbox/IoTBox/pywebdriver.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_payment_terminal%0Aversion:%2016.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
~~~~~~~
* Aurélien DUMAINE
* GRAP
* Akretion
* ACSONE SA/NV
Contributors
~~~~~~~~~~~~
* Aurelien Dumaine
* Alexis de Lattre <alexis.delattre@akretion.com>
* Sylvain LE GAL (https://twitter.com/legalsylvain)
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.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_payment_terminal>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1 @@
from . import models

View file

@ -0,0 +1,31 @@
# Copyright 2014-2020 Aurélien DUMAINE
# Copyrght 2015-2020 Akretion (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "POS Payment Terminal",
"version": "16.0.1.0.3",
"category": "Point Of Sale",
"summary": "Point of sale: support generic payment terminal",
"author": (
"Aurélien DUMAINE,"
"GRAP,"
"Akretion,"
"ACSONE SA/NV,"
"Odoo Community Association (OCA)"
),
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"depends": ["point_of_sale"],
"data": [
"views/pos_payment_method.xml",
],
"assets": {
"point_of_sale.assets": [
"pos_payment_terminal/static/src/js/payment_terminal.js",
"pos_payment_terminal/static/src/js/models.js",
],
},
"installable": True,
}

View file

@ -0,0 +1,100 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_terminal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#, python-format
msgid ""
"A payment terminal has been linked to one payment provider but the IoT Box "
"location has not been configured."
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Cannot process transactions with zero or negative amount."
msgstr "Nije moguće obraditi transakcije sa nultim ili negativnim iznosom."
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__card
msgid "Card"
msgstr "Kartica"
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__check
msgid "Check"
msgstr "Ček"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.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: pos_payment_terminal
#. odoo-python
#: code:addons/pos_payment_terminal/models/pos_payment_method.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr "OCA terminal za plaćanje"
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_mode
msgid "Payment Mode"
msgstr "Način plaćanja"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Payment Terminal Error"
msgstr "Greška terminala za plaćanje"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid ""
"Please press the red button on the payment terminal to cancel the "
"transaction."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr "Načini plaćanja na prodajnom mjestu"
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_session
msgid "Point of Sale Session"
msgstr "Sesija POS-a"
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr "Identifikator terminala"
#. module: pos_payment_terminal
#: model:ir.model.fields,help:pos_payment_terminal.field_pos_payment_method__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 ""

View file

@ -0,0 +1,147 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_terminal
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# enjolras <yo@miguelrevilla.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-01 02:01+0000\n"
"PO-Revision-Date: 2023-10-12 13:36+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\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.17\n"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#, python-format
msgid ""
"A payment terminal has been linked to one payment provider but the IoT Box "
"location has not been configured."
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Cannot process transactions with zero or negative amount."
msgstr "No se pueden procesar transacciones con importe cero o negativo."
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__card
msgid "Card"
msgstr "Tarjeta"
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__check
msgid "Check"
msgstr "Talón"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.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 ""
"No se ha podido enviar el importe a pagar al terminal de pago. Pulse el "
"botón rojo del terminal de pago e inténtelo de nuevo."
#. module: pos_payment_terminal
#. odoo-python
#: code:addons/pos_payment_terminal/models/pos_payment_method.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr "Terminal de pago OCA"
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_mode
msgid "Payment Mode"
msgstr "Forma de pago"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Payment Terminal Error"
msgstr "Error de terminal de pago"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid ""
"Please press the red button on the payment terminal to cancel the "
"transaction."
msgstr "Pulse el botón rojo del terminal de pago para cancelar la transacción."
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr "Métodos de pago en el punto de venta"
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_session
msgid "Point of Sale Session"
msgstr "Sesión del Punto de Venta"
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr "Identificador de Terminal"
#. module: pos_payment_terminal
#: model:ir.model.fields,help:pos_payment_terminal.field_pos_payment_method__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 ""
"El identificador del terminal tal y como lo conoce el proxy de hardware. "
"Dejar vacío si el proxy sólo tiene un terminal conectado."
#~ msgid "Display Name"
#~ msgstr "Mostrar Nombre"
#~ msgid "ID"
#~ msgstr "ID (identificación)"
#~ msgid "Last Modified on"
#~ msgstr "Última Modificación el"
#~ msgid "A payment terminal is available on the Proxy"
#~ msgstr "Un terminal de pago está disponible en el Proxy"
#~ msgid "Journal"
#~ msgstr "Diario"
#~ msgid "Payment Terminal"
#~ msgstr "Terminal de pago"
#~ msgid "Point of Sale Configuration"
#~ msgstr "Configuración del punto de venta"
#~ msgid "Point of Sale Orders"
#~ msgstr "Pedidos de Punto de Venta"
#~ msgid "Select the payment mode sent to the payment terminal"
#~ msgstr "Seleccione la forma de pega enviada al terminal de pago"
#~ msgid "Start transaction"
#~ msgstr "Iniciar transacción"
#~ msgid "Terminal Payment Mode"
#~ msgstr "Modo de pago del terminal"
#~ msgid "pos.config"
#~ msgstr "Configuración del TPV"

View file

@ -0,0 +1,119 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_terminal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-12-17 08:57+0000\n"
"PO-Revision-Date: 2020-12-17 08:57+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#, python-format
msgid ""
"A payment terminal has been linked to one payment provider but the IoT Box "
"location has not been configured."
msgstr ""
"Un terminal de paiement a été lié à une méthode de paiement mais "
"l'emplacement de l'IoT Box n'a pas ếté configuré."
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Cannot process transactions with zero or negative amount."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__card
msgid "Card"
msgstr "Carte"
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__check
msgid "Check"
msgstr "Chèque"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.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 ""
"Échec de l'envoi du montant à payer au lecteur CB. Appuyez sur le bouton "
"rouge du lecteur CB et essayez à nouveau."
#. module: pos_payment_terminal
#. odoo-python
#: code:addons/pos_payment_terminal/models/pos_payment_method.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr "Terminal de paiement OCA"
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_mode
msgid "Payment Mode"
msgstr "Mode de paiement"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Payment Terminal Error"
msgstr "Erreur - Lecteur CB"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid ""
"Please press the red button on the payment terminal to cancel the "
"transaction."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr "Modes de paiement du point de vente"
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_session
msgid "Point of Sale Session"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,help:pos_payment_terminal.field_pos_payment_method__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 ""
#~ msgid "Display Name"
#~ msgstr "Nom affiché"
#~ msgid "ID"
#~ msgstr "ID"
#~ msgid "Last Modified on"
#~ msgstr "Dernière modification le"
#~ msgid "Cannot process transactions with negative amount."
#~ msgstr "Impossible d'envoyer des montants négatifs au lecteur CB"

View file

@ -0,0 +1,127 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_terminal
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-13 19:51+0000\n"
"PO-Revision-Date: 2016-12-13 19:51+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/"
"hr_HR/)\n"
"Language: hr_HR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#, python-format
msgid ""
"A payment terminal has been linked to one payment provider but the IoT Box "
"location has not been configured."
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Cannot process transactions with zero or negative amount."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__card
msgid "Card"
msgstr "Kartica"
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__check
msgid "Check"
msgstr "Ček"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.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: pos_payment_terminal
#. odoo-python
#: code:addons/pos_payment_terminal/models/pos_payment_method.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_mode
msgid "Payment Mode"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Payment Terminal Error"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid ""
"Please press the red button on the payment terminal to cancel the "
"transaction."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_session
msgid "Point of Sale Session"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,help:pos_payment_terminal.field_pos_payment_method__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 ""
#~ msgid "Journal"
#~ msgstr "Dnevnik"
#, fuzzy
#~ msgid "Payment Terminal"
#~ msgstr "Način plaćanja"
#~ msgid "Select the payment mode sent to the payment terminal"
#~ msgstr "Odaberite način plaćanja korišten na naplatnom terminalu"
#~ msgid "Start transaction"
#~ msgstr "Započni transakciju"
#, fuzzy
#~ msgid "Terminal Payment Mode"
#~ msgstr "Način plaćanja"
#~ msgid "pos.config"
#~ msgstr "pos.config"

View file

@ -0,0 +1,126 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_terminal
#
# Translators:
# Francesco Fresta <franco.fresta@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-01 02:01+0000\n"
"PO-Revision-Date: 2024-12-16 11:06+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
"Language: it\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 5.6.2\n"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#, python-format
msgid ""
"A payment terminal has been linked to one payment provider but the IoT Box "
"location has not been configured."
msgstr ""
"Un terminale di pagamento è stato collegato ad un fornitore di pagamenti ma "
"l'ubicazione del box IoT non è stata configurata."
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Cannot process transactions with zero or negative amount."
msgstr "Non si possono elaborare transazioni con quantità negativa o zero."
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__card
msgid "Card"
msgstr "Carta"
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__check
msgid "Check"
msgstr "Conto"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.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 ""
"Fallito l'invio del valore da pagare al terminale di pagamento. Fare clic "
"sul pulsante rosso nel terminale di pagamento e riprovare."
#. module: pos_payment_terminal
#. odoo-python
#: code:addons/pos_payment_terminal/models/pos_payment_method.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr "Terminale pagamento OCA"
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_mode
msgid "Payment Mode"
msgstr "Metodo di pagamento"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Payment Terminal Error"
msgstr "Errore terminale pagamento"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid ""
"Please press the red button on the payment terminal to cancel the "
"transaction."
msgstr ""
"Fare clic sul pulsante rosso sul terminale pagamento per annullare la "
"transizione."
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr "Metodi di pagamento punto vendita"
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_session
msgid "Point of Sale Session"
msgstr "Sessione punto vendita"
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr "Identificatore terminale"
#. module: pos_payment_terminal
#: model:ir.model.fields,help:pos_payment_terminal.field_pos_payment_method__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 ""
"L'identificativo del terminale come conosciuto dal dispositivo proxy. "
"Lasciare vuoto se il proxy ha solo un terminale collegato."
#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"
#~ msgid "ID"
#~ msgstr "ID"
#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
#~ msgid "pos.config"
#~ msgstr "pos.config"

View file

@ -0,0 +1,109 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_terminal
#
# Translators:
# Peter Hageman <hageman.p@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-30 02:44+0000\n"
"PO-Revision-Date: 2017-05-30 02:44+0000\n"
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/"
"teams/23907/nl_NL/)\n"
"Language: nl_NL\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"
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#, python-format
msgid ""
"A payment terminal has been linked to one payment provider but the IoT Box "
"location has not been configured."
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Cannot process transactions with zero or negative amount."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__card
msgid "Card"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__check
msgid "Check"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.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: pos_payment_terminal
#. odoo-python
#: code:addons/pos_payment_terminal/models/pos_payment_method.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_mode
msgid "Payment Mode"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Payment Terminal Error"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid ""
"Please press the red button on the payment terminal to cancel the "
"transaction."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_session
msgid "Point of Sale Session"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,help:pos_payment_terminal.field_pos_payment_method__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 ""
#~ msgid "pos.config"
#~ msgstr "pos.config"

View file

@ -0,0 +1,100 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_terminal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#, python-format
msgid ""
"A payment terminal has been linked to one payment provider but the IoT Box "
"location has not been configured."
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Cannot process transactions with zero or negative amount."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__card
msgid "Card"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields.selection,name:pos_payment_terminal.selection__pos_payment_method__oca_payment_terminal_mode__check
msgid "Check"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.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: pos_payment_terminal
#. odoo-python
#: code:addons/pos_payment_terminal/models/pos_payment_method.py:0
#, python-format
msgid "OCA Payment Terminal"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_mode
msgid "Payment Mode"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/models.js:0
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid "Payment Terminal Error"
msgstr ""
#. module: pos_payment_terminal
#. odoo-javascript
#: code:addons/pos_payment_terminal/static/src/js/payment_terminal.js:0
#, python-format
msgid ""
"Please press the red button on the payment terminal to cancel the "
"transaction."
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model,name:pos_payment_terminal.model_pos_session
msgid "Point of Sale Session"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,field_description:pos_payment_terminal.field_pos_payment_method__oca_payment_terminal_id
msgid "Terminal identifier"
msgstr ""
#. module: pos_payment_terminal
#: model:ir.model.fields,help:pos_payment_terminal.field_pos_payment_method__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 ""

View file

@ -0,0 +1 @@
from . import pos_payment_method, pos_session

View file

@ -0,0 +1,25 @@
# Copyrght 2020 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, fields, models
class PosPaymentMethod(models.Model):
_inherit = "pos.payment.method"
def _get_payment_terminal_selection(self):
res = super()._get_payment_terminal_selection()
res.append(("oca_payment_terminal", _("OCA Payment Terminal")))
return res
oca_payment_terminal_mode = fields.Selection(
[("card", "Card"), ("check", "Check")], string="Payment Mode", default="card"
)
oca_payment_terminal_id = fields.Char(
string="Terminal identifier",
help=(
"The identifier of the terminal as known by the hardware proxy. "
"Leave empty if the proxy has only one terminal connected."
),
)

View file

@ -0,0 +1,13 @@
from odoo import models
class PosSession(models.Model):
_inherit = "pos.session"
def _loader_params_pos_payment_method(self):
params = super()._loader_params_pos_payment_method()
params["search_params"]["fields"].extend(
["oca_payment_terminal_mode", "oca_payment_terminal_id"]
)
return params

View file

@ -0,0 +1,5 @@
* Go to *Point of Sale > Configuration > Payment Methods*, edit the
payment method corresponding to the card reader and set
the field *Use a payment terminal* to *OCA Payment Terminal*. A new field *Payment Mode* will appear, that has *Card* as defaut value. If the payment method is for Checks and you have a check printer, select *Check* instead.
.. figure:: ../static/description/pos_payment_method_form.png

View file

@ -0,0 +1,3 @@
* Aurelien Dumaine
* Alexis de Lattre <alexis.delattre@akretion.com>
* Sylvain LE GAL (https://twitter.com/legalsylvain)

View file

@ -0,0 +1,2 @@
This module adds support for credit card reader and checks printer
in the Point of Sale.

View file

@ -0,0 +1,9 @@
This module is designed to be installed on the
*main Odoo server*. On the *POSbox/IoTbox*, you should install the module
*hw_x* depending on the protocol implemented in your device. Remember that the POSbox/IoTbox runs Odoo v12 (even if your Odoo server runs v13 or v14), so you should look in the 12.0 branch of the `OCA POS project <https://github.com/OCA/pos>`_ to find the *hw_x* modules.
`Ingenico <http://en.wikipedia.org/wiki/Ingenico>`
card readers for France support the Telium protocol implemented in the
*hw_telium_payment_terminal* module for the POSbox/IoTBox.
You can also consider `pywebdriver project <https://github.com/akretion/pywebdriver>`_ as an alternative to the POSbox/IoTbox.

View file

@ -0,0 +1 @@
In the frontend of the POS, when you select a payment method that has a payment mode with *Use a Payment Terminal* set to *OCA Payment Terminal*, you will have an additionnal *Send* button: if you click on that button, the amount, the currency and the payment mode will be sent to the POSbox/IoTBox/pywebdriver.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,457 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>POS Payment Terminal</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="pos-payment-terminal">
<h1 class="title">POS Payment Terminal</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:90c98f4f7f6b65736ec4de9619ac22856ba9e32c5c63cb5444c4b63c381bab13
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/pos/tree/16.0/pos_payment_terminal"><img alt="OCA/pos" src="https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_payment_terminal"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/pos&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds support for credit card reader and checks printer
in the Point of Sale.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-3">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-8">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<p>This module is designed to be installed on the
<em>main Odoo server</em>. On the <em>POSbox/IoTbox</em>, you should install the module
<em>hw_x</em> depending on the protocol implemented in your device. Remember that the POSbox/IoTbox runs Odoo v12 (even if your Odoo server runs v13 or v14), so you should look in the 12.0 branch of the <a class="reference external" href="https://github.com/OCA/pos">OCA POS project</a> to find the <em>hw_x</em> modules.</p>
<p><cite>Ingenico &lt;http://en.wikipedia.org/wiki/Ingenico&gt;</cite>
card readers for France support the Telium protocol implemented in the
<em>hw_telium_payment_terminal</em> module for the POSbox/IoTBox.</p>
<p>You can also consider <a class="reference external" href="https://github.com/akretion/pywebdriver">pywebdriver project</a> as an alternative to the POSbox/IoTbox.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
<ul class="simple">
<li>Go to <em>Point of Sale &gt; Configuration &gt; Payment Methods</em>, edit the
payment method corresponding to the card reader and set
the field <em>Use a payment terminal</em> to <em>OCA Payment Terminal</em>. A new field <em>Payment Mode</em> will appear, that has <em>Card</em> as defaut value. If the payment method is for Checks and you have a check printer, select <em>Check</em> instead.</li>
</ul>
<div class="figure">
<img alt="https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_terminal/static/description/pos_payment_method_form.png" src="https://raw.githubusercontent.com/OCA/pos/16.0/pos_payment_terminal/static/description/pos_payment_method_form.png" />
</div>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
<p>In the frontend of the POS, when you select a payment method that has a payment mode with <em>Use a Payment Terminal</em> set to <em>OCA Payment Terminal</em>, you will have an additionnal <em>Send</em> button: if you click on that button, the amount, the currency and the payment mode will be sent to the POSbox/IoTBox/pywebdriver.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/pos/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_payment_terminal%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
<ul class="simple">
<li>Aurélien DUMAINE</li>
<li>GRAP</li>
<li>Akretion</li>
<li>ACSONE SA/NV</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<ul class="simple">
<li>Aurelien Dumaine</li>
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
<li>Sylvain LE GAL (<a class="reference external" href="https://twitter.com/legalsylvain">https://twitter.com/legalsylvain</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/16.0/pos_payment_terminal">OCA/pos</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View file

@ -0,0 +1,93 @@
/*
POS Payment Terminal module for Odoo
Copyright (C) 2014-2020 Aurélien DUMAINE
Copyright (C) 2014-2020 Akretion (www.akretion.com)
@author: Aurélien DUMAINE
@author: Alexis de Lattre <alexis.delattre@akretion.com>
@author: Denis Roussel <denis.roussel@acsone.eu>
@author: Stéphane Bidoul <stephane.bidoul@acsone.eu>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
*/
odoo.define("pos_payment_terminal.models", function (require) {
"use strict";
var core = require("web.core");
var models = require("point_of_sale.models");
const {PosGlobalState, Payment} = require("point_of_sale.models");
const Registries = require("point_of_sale.Registries");
var _t = core._t;
var OCAPaymentTerminal = require("pos_payment_terminal.payment");
models.register_payment_method("oca_payment_terminal", OCAPaymentTerminal);
const PosPaymentTerminalPosGlobalState = (OriginalPosGlobalState) =>
class extends OriginalPosGlobalState {
// @override
async after_load_server_data() {
for (var index in this.payment_methods) {
var payment_method = this.payment_methods[index];
var payment_method_id = payment_method.id;
if (
this.config.payment_method_ids.indexOf(payment_method_id) === -1
) {
continue;
}
if (
payment_method.use_payment_terminal === "oca_payment_terminal"
) {
this.config.use_proxy = true;
}
}
if (Boolean(!this.config.proxy_ip) && this.config.use_proxy) {
throw new Error(_t("Payment Terminal Error"), {
cause: {
message: _t(
"A payment terminal has been linked to one payment provider but the IoT " +
"Box location has not been configured."
),
},
});
}
return await super.after_load_server_data(...arguments);
}
};
Registries.Model.extend(PosGlobalState, PosPaymentTerminalPosGlobalState);
const PosPaymentTerminalPayment = (OriginalPayment) =>
class extends OriginalPayment {
constructor() {
super(...arguments);
// Id of the terminal transaction, used to find the payment
// line corresponding to a terminal transaction status coming
// from the terminal driver.
this.terminal_transaction_id = null;
// Success: null: in progress, false: failed: true: succeeded
this.terminal_transaction_success = null;
// Human readable transaction status, set if the transaction failed.
this.terminal_transaction_status = null;
// Additional information about the transaction status.
this.terminal_transaction_status_details = null;
}
// @override
init_from_JSON(json) {
super.init_from_JSON(json);
this.terminal_transaction_id = json.terminal_transaction_id;
this.terminal_transaction_success = json.terminal_transaction_success;
this.terminal_transaction_status = json.terminal_transaction_status;
this.terminal_transaction_status_details =
json.terminal_transaction_status_details;
}
// @override
export_as_JSON() {
var vals = super.export_as_JSON();
vals.terminal_transaction_id = this.terminal_transaction_id;
vals.terminal_transaction_success = this.terminal_transaction_success;
vals.terminal_transaction_status_details =
this.terminal_transaction_status_details;
return vals;
}
};
Registries.Model.extend(Payment, PosPaymentTerminalPayment);
});

View file

@ -0,0 +1,191 @@
/*
Copyright 2020 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
@author: Stéphane Bidoul <stephane.bidoul@acsone.eu>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
*/
odoo.define("pos_payment_terminal.payment", function (require) {
"use strict";
var core = require("web.core");
var PaymentInterface = require("point_of_sale.PaymentInterface");
const {Gui} = require("point_of_sale.Gui");
var _t = core._t;
var OCAPaymentTerminal = PaymentInterface.extend({
init: function () {
this._super.apply(this, arguments);
},
send_payment_request: function () {
this._super.apply(this, arguments);
return this._oca_payment_terminal_pay();
},
send_payment_cancel: function () {
this._super.apply(this, arguments);
this._show_error(
_t(
"Please press the red button on the payment terminal to cancel the transaction."
)
);
return Promise.reject();
},
_oca_payment_terminal_pay: function () {
var order = this.pos.get_order();
var pay_line = order.selected_paymentline;
var currency = this.pos.currency;
if (pay_line.amount <= 0) {
// TODO check if it's possible or not
this._show_error(
_t("Cannot process transactions with zero or negative amount.")
);
return Promise.resolve();
}
var data = {
amount: pay_line.amount,
currency_iso: currency.name,
currency_decimals: currency.decimals,
payment_mode: this.payment_method.oca_payment_terminal_mode,
payment_id: pay_line.cid,
order_id: order.name,
};
if (this.payment_method.oca_payment_terminal_id) {
data.terminal_id = this.payment_method.oca_payment_terminal_id;
}
return this._oca_payment_terminal_proxy_request(data).then((response) => {
if (response === false) {
this._show_error(
_t(
"Failed to send the amount to pay to the payment terminal. Press the red button on the payment terminal and try again."
)
);
// There was an error, let the user retry.
return false;
} else if (response instanceof Object && "transaction_id" in response) {
// The response has a terminal transaction identifier:
// return a promise that polls for transaction status.
pay_line.set_payment_status("waitingCard");
this._oca_update_payment_line_terminal_transaction_status(
pay_line,
response
);
return new Promise((resolve, reject) => {
this._oca_poll_for_transaction_status(
pay_line,
resolve,
reject
);
});
}
// The transaction was started, but the terminal driver
// does not report status, so we won't know the
// transaction result: we let the user enter the
// outcome manually. This is done by rejecting the
// promise as explained in the send_payment_request()
// documentation.
pay_line.set_payment_status("force_done");
return Promise.reject();
});
},
_oca_poll_for_transaction_status: function (pay_line, resolve, reject) {
var timerId = setInterval(() => {
// Query the driver status more frequently than the regular POS
// proxy, to get faster feedback when the transaction is
// complete on the terminal.
var status_params = {};
if (this.payment_method.oca_payment_terminal_id) {
status_params.terminal_id =
this.payment_method.oca_payment_terminal_id;
}
this.pos.env.proxy.connection
.rpc("/hw_proxy/status_json", status_params, {
shadow: true,
timeout: 1000,
})
.then((drivers_status) => {
for (var driver_name in drivers_status) {
// Look for a driver that is a payment terminal and has
// transactions.
var driver = drivers_status[driver_name];
if (!driver.is_terminal || !("transactions" in driver)) {
continue;
}
for (var transaction_id in driver.transactions) {
var transaction = driver.transactions[transaction_id];
if (
transaction.transaction_id ===
pay_line.terminal_transaction_id
) {
// Look for the transaction corresponding to
// the payment line.
this._oca_update_payment_line_terminal_transaction_status(
pay_line,
transaction
);
if (
pay_line.terminal_transaction_success !== null
) {
resolve(pay_line.terminal_transaction_success);
// Stop the loop
clearInterval(timerId);
}
}
}
}
})
.catch(() => {
console.error("Error querying terminal driver status");
// We could not query the transaction status so we
// won't know the transaction result: we let the user
// enter the outcome manually. This is done by
// rejecting the promise as explained in the
// send_payment_request() documentation.
pay_line.set_payment_status("force_done");
reject();
// Stop the loop
clearInterval(timerId);
});
}, 1000);
},
_oca_update_payment_line_terminal_transaction_status: function (
pay_line,
transaction
) {
pay_line.terminal_transaction_id = transaction.transaction_id;
pay_line.terminal_transaction_success = transaction.success;
pay_line.terminal_transaction_status = transaction.status;
pay_line.terminal_transaction_status_details = transaction.status_details;
// Payment transaction reference, for accounting reconciliation purposes.
pay_line.transaction_id = transaction.reference;
},
_oca_payment_terminal_proxy_request: function (data) {
return this.pos.env.proxy
.message("payment_terminal_transaction_start", {
payment_info: JSON.stringify(data),
})
.then((response) => {
return response;
})
.catch(() => {
console.error("Error starting payment transaction");
return false;
});
},
_show_error: function (msg, title) {
Gui.showPopup("ErrorPopup", {
title: title || _t("Payment Terminal Error"),
body: msg,
});
},
});
return OCAPaymentTerminal;
});

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="pos_payment_method_view_form" model="ir.ui.view">
<field name="model">pos.payment.method</field>
<field name="inherit_id" ref="point_of_sale.pos_payment_method_view_form" />
<field name="arch" type="xml">
<field name="use_payment_terminal" position="after">
<field
name="oca_payment_terminal_mode"
attrs="{'invisible': [('use_payment_terminal', '!=', 'oca_payment_terminal')]}"
/>
<field
name="oca_payment_terminal_id"
attrs="{'invisible': [('use_payment_terminal', '!=', 'oca_payment_terminal')]}"
/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-pos-pos_payment_terminal"
version = "16.0.0"
description = "POS Payment Terminal - Point of sale: support generic payment terminal"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-point_of_sale>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["pos_payment_terminal"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]