Skip to content
Draft
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
124 changes: 124 additions & 0 deletions pos_payment_method_cashdro/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
==========================
PoS Payment Method CashDro
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:395fd3a96489361b1f59537f222d4d570a5ba750ced74e3eb03fd89245aeb72a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.0/pos_payment_method_cashdro
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_payment_method_cashdro
: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=18.0
:alt: Try me on Runboat

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

This module allows to make payments with a Cashdro
(https://www.cashdro.com) terminal on the Point of Sale frontend.

**Table of contents**

.. contents::
:local:

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

To add a Cashdro payment terminal:

1. Go to *Point of Sale > Configuration > Payment Methods*
2. Choose a cash payment method or create a new one.
3. Select *Cashdro* in the *Use a Payment Terminal* field.
4. Configure the Cashdro terminal hostname and credentials.
5. Configure the desired, Cashdro terminal in the proper PoS
configurations.

Note that if a single payment method was used for cash in different
stores, it should be splitted in as many phisical stores there are.

Usage
=====

With the proper configuration made:

1. Make a new PoS order and choose the cash payment method configured
with the Cashdro settings.
2. Click on *Send* to send the request to the Cashdro terminal that will
ask the customer for the amount to pay.
3. The cashier can cancel the amount request discarding the line
clicking on the (x) symbol.
4. When the customer pays the sale amount in the terminal, the Cashdro
reports the amount received and change delivered back.
5. The Point of Sale reflects it in the payment line and thus the order
can be validated now.

Known issues / Roadmap
======================

- Integrate cash control (money inputs / outputs).

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_method_cashdro%0Aversion:%2018.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
-------

* Tecnativa

Contributors
------------

- `Acysos S.L. <https://www.acysos.com>`__:

- Ignacio Ibeas

- `Tecnativa <https://www.tecnativa.com>`__

- David Vidal

- `ACSONE SA/NV <https://acsone.eu>`__:

- Bejaoui Souheil
- Denis Roussel

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/18.0/pos_payment_method_cashdro>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pos_payment_method_cashdro/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions pos_payment_method_cashdro/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "PoS Payment Method CashDro",
"summary": "Allows to pay with CashDro Terminals on the Point of Sale",
"version": "18.0.1.0.0",
"category": "Point Of Sale",
"website": "https://github.com/OCA/pos",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
"point_of_sale",
],
"data": [
"views/pos_payment_method_views.xml",
],
"assets": {
"point_of_sale._assets_pos": ["pos_payment_method_cashdro/static/src/**/*"],
},
}
56 changes: 56 additions & 0 deletions pos_payment_method_cashdro/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_method_cashdro
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-03-05 14:40+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\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 4.17\n"

#. module: pos_payment_method_cashdro
#: model:ir.model.fields,field_description:pos_payment_method_cashdro.field_pos_payment_method__cashdro_password
msgid "Cashdro Password"
msgstr "Password Cashdro"

#. module: pos_payment_method_cashdro
#: model:ir.model.fields,field_description:pos_payment_method_cashdro.field_pos_payment_method__cashdro_host
msgid "Cashdro Terminal Host Name or IP address"
msgstr "Nome host terminale Cashdro o indirizzo IP"

#. module: pos_payment_method_cashdro
#: model:ir.model.fields,field_description:pos_payment_method_cashdro.field_pos_payment_method__cashdro_user
msgid "Cashdro User"
msgstr "Utente Cashdro"

#. module: pos_payment_method_cashdro
#: model:ir.model.fields,help:pos_payment_method_cashdro.field_pos_payment_method__cashdro_host
msgid "It must be reachable by the PoS in the store"
msgstr "Deve essere raggiungibile dal POS nel negozio"

#. module: pos_payment_method_cashdro
#: model:ir.model,name:pos_payment_method_cashdro.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr "Metodi di pagamento punto vendita"

#. module: pos_payment_method_cashdro
#: model:ir.model,name:pos_payment_method_cashdro.model_pos_session
msgid "Point of Sale Session"
msgstr "Sessione punto vendita"

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
44 changes: 44 additions & 0 deletions pos_payment_method_cashdro/i18n/pos_payment_method_cashdro.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_payment_method_cashdro
#
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_method_cashdro
#: model:ir.model.fields,field_description:pos_payment_method_cashdro.field_pos_payment_method__cashdro_password
msgid "Cashdro Password"
msgstr ""

#. module: pos_payment_method_cashdro
#: model:ir.model.fields,field_description:pos_payment_method_cashdro.field_pos_payment_method__cashdro_host
msgid "Cashdro Terminal Host Name or IP address"
msgstr ""

#. module: pos_payment_method_cashdro
#: model:ir.model.fields,field_description:pos_payment_method_cashdro.field_pos_payment_method__cashdro_user
msgid "Cashdro User"
msgstr ""

#. module: pos_payment_method_cashdro
#: model:ir.model.fields,help:pos_payment_method_cashdro.field_pos_payment_method__cashdro_host
msgid "It must be reachable by the PoS in the store"
msgstr ""

#. module: pos_payment_method_cashdro
#: model:ir.model,name:pos_payment_method_cashdro.model_pos_payment_method
msgid "Point of Sale Payment Methods"
msgstr ""

#. module: pos_payment_method_cashdro
#: model:ir.model,name:pos_payment_method_cashdro.model_pos_session
msgid "Point of Sale Session"
msgstr ""
2 changes: 2 additions & 0 deletions pos_payment_method_cashdro/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import pos_payment_method
from . import pos_session
35 changes: 35 additions & 0 deletions pos_payment_method_cashdro/models/pos_payment_method.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2021 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models


class PosPaymentMethod(models.Model):
_inherit = "pos.payment.method"

def _get_payment_terminal_selection(self):
return super()._get_payment_terminal_selection() + [("cashdro", "Cashdro")]

Check warning on line 10 in pos_payment_method_cashdro/models/pos_payment_method.py

View check run for this annotation

Codecov / codecov/patch

pos_payment_method_cashdro/models/pos_payment_method.py#L10

Added line #L10 was not covered by tests

cashdro_host = fields.Char(
string="Cashdro Terminal Host Name or IP address",
help="It must be reachable by the PoS in the store",
)
cashdro_user = fields.Char()
cashdro_password = fields.Char()

def _onchange_journal_id(self):
"""Cash payment method force the `use_payment_terminal` to `False` as
it's assumed that a cash journal can't have a payment terminal. Let's keep
the method when it's needed"""
res = super()._onchange_journal_id()

Check warning on line 23 in pos_payment_method_cashdro/models/pos_payment_method.py

View check run for this annotation

Codecov / codecov/patch

pos_payment_method_cashdro/models/pos_payment_method.py#L23

Added line #L23 was not covered by tests
if self.use_payment_terminal != "cashdro" and not self.is_cash_count:
return res
self.use_payment_terminal = "cashdro"

Check warning on line 26 in pos_payment_method_cashdro/models/pos_payment_method.py

View check run for this annotation

Codecov / codecov/patch

pos_payment_method_cashdro/models/pos_payment_method.py#L25-L26

Added lines #L25 - L26 were not covered by tests

def _compute_hide_use_payment_terminal(self):
"""Now that we have the option to choose a payment terminal for the cashdro
payments, we can show the terminal options for cash payment types."""
cash_payment_types = self.filtered(lambda x: x.type == "cash")
cash_payment_types.hide_use_payment_terminal = False
return super(

Check warning on line 33 in pos_payment_method_cashdro/models/pos_payment_method.py

View check run for this annotation

Codecov / codecov/patch

pos_payment_method_cashdro/models/pos_payment_method.py#L31-L33

Added lines #L31 - L33 were not covered by tests
PosPaymentMethod, self - cash_payment_types
)._compute_hide_use_payment_terminal()
14 changes: 14 additions & 0 deletions pos_payment_method_cashdro/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models


class PosSession(models.Model):
_inherit = "pos.session"

def _loader_params_pos_payment_method(self):
result = super()._loader_params_pos_payment_method()
result["search_params"]["fields"].extend(

Check warning on line 11 in pos_payment_method_cashdro/models/pos_session.py

View check run for this annotation

Codecov / codecov/patch

pos_payment_method_cashdro/models/pos_session.py#L10-L11

Added lines #L10 - L11 were not covered by tests
["cashdro_host", "cashdro_user", "cashdro_password"]
)
return result

Check warning on line 14 in pos_payment_method_cashdro/models/pos_session.py

View check run for this annotation

Codecov / codecov/patch

pos_payment_method_cashdro/models/pos_session.py#L14

Added line #L14 was not covered by tests
3 changes: 3 additions & 0 deletions pos_payment_method_cashdro/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
11 changes: 11 additions & 0 deletions pos_payment_method_cashdro/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
To add a Cashdro payment terminal:

1. Go to *Point of Sale \> Configuration \> Payment Methods*
2. Choose a cash payment method or create a new one.
3. Select *Cashdro* in the *Use a Payment Terminal* field.
4. Configure the Cashdro terminal hostname and credentials.
5. Configure the desired, Cashdro terminal in the proper PoS
configurations.

Note that if a single payment method was used for cash in different
stores, it should be splitted in as many phisical stores there are.
7 changes: 7 additions & 0 deletions pos_payment_method_cashdro/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- [Acysos S.L.](https://www.acysos.com):
- Ignacio Ibeas
- [Tecnativa](https://www.tecnativa.com)
- David Vidal
- [ACSONE SA/NV](https://acsone.eu):
- Bejaoui Souheil
- Denis Roussel
2 changes: 2 additions & 0 deletions pos_payment_method_cashdro/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to make payments with a Cashdro
(<https://www.cashdro.com>) terminal on the Point of Sale frontend.
1 change: 1 addition & 0 deletions pos_payment_method_cashdro/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Integrate cash control (money inputs / outputs).
12 changes: 12 additions & 0 deletions pos_payment_method_cashdro/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
With the proper configuration made:

1. Make a new PoS order and choose the cash payment method configured
with the Cashdro settings.
2. Click on *Send* to send the request to the Cashdro terminal that
will ask the customer for the amount to pay.
3. The cashier can cancel the amount request discarding the line
clicking on the (x) symbol.
4. When the customer pays the sale amount in the terminal, the Cashdro
reports the amount received and change delivered back.
5. The Point of Sale reflects it in the payment line and thus the order
can be validated now.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading