Skip to content

Commit

Permalink
[17.0][MIG] pos_payment_method_cashdro
Browse files Browse the repository at this point in the history
  • Loading branch information
sbejaoui committed Jun 24, 2024
1 parent e5ef634 commit f70597c
Show file tree
Hide file tree
Showing 18 changed files with 167 additions and 149 deletions.
Binary file added pandoc-3.2-1-amd64.deb
Binary file not shown.
69 changes: 37 additions & 32 deletions pos_payment_method_cashdro/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ PoS Payment Method CashDro
: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_method_cashdro
:target: https://github.com/OCA/pos/tree/17.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-16-0/pos-16-0-pos_payment_method_cashdro
:target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-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=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=17.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.
This module allows to make payments with a Cashdro
(https://www.cashdro.com) terminal on the Point of Sale frontend.

**Table of contents**

Expand All @@ -41,67 +41,72 @@ Configuration

To add a Cashdro payment terminal:

#. Go to *Point of Sale > Configuration > Payment Methods*
#. Choose a cash payment method or create a new one.
#. Select *Cashdro* in the *Use a Payment Terminal* field.
#. Configure the Cashdro terminal hostname and credentials.
#. Configure the desired, Cashdro terminal in the proper PoS configurations.
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.
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:

#. Make a new PoS order and choose the cash payment method configured with the Cashdro
settings.
#. Click on *Send* to send the request to the Cashdro terminal that will ask the
customer for the amount to pay.
#. The cashier can cancel the amount request discarding the line clicking on the (x)
symbol.
#. When the customer pays the sale amount in the terminal, the Cashdro reports the
amount received and change delivered back.
#. The Point of Sale reflects it in the payment line and thus the order can be validated
now.
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).
- 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:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_payment_method_cashdro%0Aversion:%2017.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>`_:
- `Acysos S.L. <https://www.acysos.com>`__:

* Ignacio Ibeas
- Ignacio Ibeas

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

* David Vidal
- David Vidal

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

- Bejaoui Souheil

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -113,6 +118,6 @@ 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_method_cashdro>`_ project on GitHub.
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/17.0/pos_payment_method_cashdro>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions pos_payment_method_cashdro/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "PoS Payment Method CashDro",
"summary": "Allows to pay with CashDro Terminals on the Point of Sale",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Point Of Sale",
"website": "https://github.com/OCA/pos",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand All @@ -15,6 +15,6 @@
"views/pos_payment_method_views.xml",
],
"assets": {
"point_of_sale.assets": ["pos_payment_method_cashdro/static/src/js/*.js"],
"point_of_sale._assets_pos": ["pos_payment_method_cashdro/static/src/**/*"],
},
}
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.
10 changes: 0 additions & 10 deletions pos_payment_method_cashdro/readme/CONFIGURE.rst

This file was deleted.

6 changes: 6 additions & 0 deletions pos_payment_method_cashdro/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- [Acysos S.L.](https://www.acysos.com):
- Ignacio Ibeas
- [Tecnativa](https://www.tecnativa.com)
- David Vidal
- [ACSONE SA/NV](https://acsone.eu):
- Bejaoui Souheil
7 changes: 0 additions & 7 deletions pos_payment_method_cashdro/readme/CONTRIBUTORS.rst

This file was deleted.

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.
2 changes: 0 additions & 2 deletions pos_payment_method_cashdro/readme/DESCRIPTION.rst

This file was deleted.

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).
1 change: 0 additions & 1 deletion pos_payment_method_cashdro/readme/ROADMAP.rst

This file was deleted.

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.
12 changes: 0 additions & 12 deletions pos_payment_method_cashdro/readme/USAGE.rst

This file was deleted.

41 changes: 23 additions & 18 deletions pos_payment_method_cashdro/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ <h1 class="title">PoS Payment Method CashDro</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:395fd3a96489361b1f59537f222d4d570a5ba750ced74e3eb03fd89245aeb72a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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_method_cashdro"><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_method_cashdro"><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 allows to make payments with a Cashdro (<a class="reference external" href="https://www.cashdro.com">https://www.cashdro.com</a>) terminal
on the Point of Sale frontend.</p>
<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/17.0/pos_payment_method_cashdro"><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-17-0/pos-17-0-pos_payment_method_cashdro"><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=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to make payments with a Cashdro
(<a class="reference external" href="https://www.cashdro.com">https://www.cashdro.com</a>) terminal on the Point of Sale frontend.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -394,25 +394,26 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<li>Choose a cash payment method or create a new one.</li>
<li>Select <em>Cashdro</em> in the <em>Use a Payment Terminal</em> field.</li>
<li>Configure the Cashdro terminal hostname and credentials.</li>
<li>Configure the desired, Cashdro terminal in the proper PoS configurations.</li>
<li>Configure the desired, Cashdro terminal in the proper PoS
configurations.</li>
</ol>
<p>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.</p>
<p>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.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<p>With the proper configuration made:</p>
<ol class="arabic simple">
<li>Make a new PoS order and choose the cash payment method configured with the Cashdro
settings.</li>
<li>Click on <em>Send</em> to send the request to the Cashdro terminal that will ask the
customer for the amount to pay.</li>
<li>The cashier can cancel the amount request discarding the line clicking on the (x)
symbol.</li>
<li>When the customer pays the sale amount in the terminal, the Cashdro reports the
amount received and change delivered back.</li>
<li>The Point of Sale reflects it in the payment line and thus the order can be validated
now.</li>
<li>Make a new PoS order and choose the cash payment method configured
with the Cashdro settings.</li>
<li>Click on <em>Send</em> to send the request to the Cashdro terminal that will
ask the customer for the amount to pay.</li>
<li>The cashier can cancel the amount request discarding the line
clicking on the (x) symbol.</li>
<li>When the customer pays the sale amount in the terminal, the Cashdro
reports the amount received and change delivered back.</li>
<li>The Point of Sale reflects it in the payment line and thus the order
can be validated now.</li>
</ol>
</div>
<div class="section" id="known-issues-roadmap">
Expand All @@ -426,7 +427,7 @@ <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_method_cashdro%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/pos/issues/new?body=module:%20pos_payment_method_cashdro%0Aversion:%2017.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">
Expand All @@ -448,6 +449,10 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>David Vidal</li>
</ul>
</li>
<li><a class="reference external" href="https://acsone.eu">ACSONE SA/NV</a>:<ul>
<li>Bejaoui Souheil</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -457,7 +462,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<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_method_cashdro">OCA/pos</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/pos/tree/17.0/pos_payment_method_cashdro">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>
Expand Down
50 changes: 24 additions & 26 deletions pos_payment_method_cashdro/static/src/js/models.esm.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
/** @odoo-module */
/* Copyright 2021 Tecnativa - David Vidal
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).*/
import {Order, register_payment_method} from "point_of_sale.models";
import {Order} from "@point_of_sale/app/store/models";
import {PaymentCashdro} from "./payment_cashdro.esm";
import Registries from "point_of_sale.Registries";
import {patch} from "@web/core/utils/patch";
import {register_payment_method} from "@point_of_sale/app/store/pos_store";

register_payment_method("cashdro", PaymentCashdro);

const PaymentCashdroOrder = (OriginalOrder) =>
class extends OriginalOrder {
constructor() {
super(...arguments);
this.in_cashdro_transaction = false;
}
/**
* @override
* Set the amount to 0 as it's going to be filled by the Cashdro response
*/
add_paymentline() {
const line = super.add_paymentline(...arguments);
if (!line) {
return line;
}
if (
line.payment_method &&
line.payment_method.use_payment_terminal === "cashdro"
) {
line.set_amount(0);
}
patch(Order.prototype, {
setup() {
super.setup(...arguments);
this.in_cashdro_transaction = false;
},
/**
* @override
* Set the amount to 0 as it's going to be filled by the Cashdro response
*/
add_paymentline(payment_method) {
const line = super.add_paymentline(payment_method);
if (!line) {
return line;
}
};

Registries.Model.extend(Order, PaymentCashdroOrder);
if (
line.payment_method &&
line.payment_method.use_payment_terminal === "cashdro"
) {
line.set_amount(0);
}
return line;
},
});
Loading

0 comments on commit f70597c

Please sign in to comment.