diff --git a/pos_settle_due_deposit_money/README.rst b/pos_settle_due_deposit_money/README.rst new file mode 100644 index 0000000000..d97c16f13f --- /dev/null +++ b/pos_settle_due_deposit_money/README.rst @@ -0,0 +1,99 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================ +POS Settle Due Deposit Money +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7c189ffe61ce6393d1f49a8743e2d7b6a349871743d278ed382d6d6bdb13ad88 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github + :target: https://github.com/OCA/pos/tree/19.0/pos_settle_due_deposit_money + :alt: OCA/pos +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/pos-19-0/pos-19-0-pos_settle_due_deposit_money + :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=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +In the Point of Sale, the *Deposit money* option of the customer line +(provided by the *Point of Sale Settle Due* module) is only shown when +the customer has no due amount. As soon as the customer has open +invoices or orders, only the settle options (*Settle invoices*, *Settle +orders*, *Settle due amount*) are available. + +This module keeps the *Deposit money* option always available, so the +cashier can register a customer deposit even when the customer has +pending invoices that should not be settled yet (e.g. invoices under +review). + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +1. Open a Point of Sale session with a *Customer Account* (pay later) + payment method configured. +2. Open the customer list and click the options button of a customer + with due invoices or orders. +3. The *Deposit money* option is shown next to the settle options. Click + it, select the payment method and register the deposit as usual. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Jarsa + +Contributors +------------ + +- Jesús Alan Ramos Rodríguez + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pos_settle_due_deposit_money/__init__.py b/pos_settle_due_deposit_money/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pos_settle_due_deposit_money/__manifest__.py b/pos_settle_due_deposit_money/__manifest__.py new file mode 100644 index 0000000000..81bdcbe400 --- /dev/null +++ b/pos_settle_due_deposit_money/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2026 Jarsa +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +{ + "name": "POS Settle Due Deposit Money", + "version": "19.0.1.0.0", + "summary": "Keep the Deposit money option available " + "when the customer has due amounts", + "author": "Jarsa, Odoo Community Association (OCA)", + "license": "LGPL-3", + "category": "Point of Sale", + "website": "https://github.com/OCA/pos", + "depends": ["pos_settle_due"], + "assets": { + "point_of_sale._assets_pos": [ + "pos_settle_due_deposit_money/static/src/**/*", + ], + "web.assets_tests": [ + "pos_settle_due_deposit_money/static/tests/tours/**/*", + ], + }, + "installable": True, +} diff --git a/pos_settle_due_deposit_money/i18n/es.po b/pos_settle_due_deposit_money/i18n/es.po new file mode 100644 index 0000000000..1445e704f2 --- /dev/null +++ b/pos_settle_due_deposit_money/i18n/es.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pos_settle_due_deposit_money +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 19.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: pos_settle_due_deposit_money +#. odoo-javascript +#: code:addons/pos_settle_due_deposit_money/static/src/app/screens/partner_list/partner_line/partner_line.xml:0 +msgid "Deposit money" +msgstr "Depositar dinero" diff --git a/pos_settle_due_deposit_money/pyproject.toml b/pos_settle_due_deposit_money/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/pos_settle_due_deposit_money/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/pos_settle_due_deposit_money/readme/CONTRIBUTORS.md b/pos_settle_due_deposit_money/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..cbe0ec793d --- /dev/null +++ b/pos_settle_due_deposit_money/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Jesús Alan Ramos Rodríguez \<\> diff --git a/pos_settle_due_deposit_money/readme/DESCRIPTION.md b/pos_settle_due_deposit_money/readme/DESCRIPTION.md new file mode 100644 index 0000000000..50c1849afd --- /dev/null +++ b/pos_settle_due_deposit_money/readme/DESCRIPTION.md @@ -0,0 +1,9 @@ +In the Point of Sale, the *Deposit money* option of the customer line +(provided by the *Point of Sale Settle Due* module) is only shown when the +customer has no due amount. As soon as the customer has open invoices or +orders, only the settle options (*Settle invoices*, *Settle orders*, *Settle +due amount*) are available. + +This module keeps the *Deposit money* option always available, so the cashier +can register a customer deposit even when the customer has pending invoices +that should not be settled yet (e.g. invoices under review). diff --git a/pos_settle_due_deposit_money/readme/USAGE.md b/pos_settle_due_deposit_money/readme/USAGE.md new file mode 100644 index 0000000000..7dafa734fe --- /dev/null +++ b/pos_settle_due_deposit_money/readme/USAGE.md @@ -0,0 +1,6 @@ +1. Open a Point of Sale session with a *Customer Account* (pay later) + payment method configured. +2. Open the customer list and click the options button of a customer with + due invoices or orders. +3. The *Deposit money* option is shown next to the settle options. Click it, + select the payment method and register the deposit as usual. diff --git a/pos_settle_due_deposit_money/static/description/index.html b/pos_settle_due_deposit_money/static/description/index.html new file mode 100644 index 0000000000..89bb0fa761 --- /dev/null +++ b/pos_settle_due_deposit_money/static/description/index.html @@ -0,0 +1,449 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

POS Settle Due Deposit Money

+ +

Beta License: LGPL-3 OCA/pos Translate me on Weblate Try me on Runboat

+

In the Point of Sale, the Deposit money option of the customer line +(provided by the Point of Sale Settle Due module) is only shown when +the customer has no due amount. As soon as the customer has open +invoices or orders, only the settle options (Settle invoices, Settle +orders, Settle due amount) are available.

+

This module keeps the Deposit money option always available, so the +cashier can register a customer deposit even when the customer has +pending invoices that should not be settled yet (e.g. invoices under +review).

+

Table of contents

+ +
+

Usage

+
    +
  1. Open a Point of Sale session with a Customer Account (pay later) +payment method configured.
  2. +
  3. Open the customer list and click the options button of a customer +with due invoices or orders.
  4. +
  5. The Deposit money option is shown next to the settle options. Click +it, select the payment method and register the deposit as usual.
  6. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Jarsa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/pos_settle_due_deposit_money/static/src/app/screens/partner_list/partner_line/partner_line.xml b/pos_settle_due_deposit_money/static/src/app/screens/partner_list/partner_line/partner_line.xml new file mode 100644 index 0000000000..e2a793d300 --- /dev/null +++ b/pos_settle_due_deposit_money/static/src/app/screens/partner_list/partner_line/partner_line.xml @@ -0,0 +1,17 @@ + + + + + + Deposit money + + + + diff --git a/pos_settle_due_deposit_money/static/tests/tours/pos_settle_due_deposit_money_tour.esm.js b/pos_settle_due_deposit_money/static/tests/tours/pos_settle_due_deposit_money_tour.esm.js new file mode 100644 index 0000000000..a4606dc505 --- /dev/null +++ b/pos_settle_due_deposit_money/static/tests/tours/pos_settle_due_deposit_money_tour.esm.js @@ -0,0 +1,24 @@ +/* eslint-disable */ +import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util"; +import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util"; +import * as PartnerList from "@point_of_sale/../tests/pos/tours/utils/partner_list_util"; +import * as ProductScreen from "@point_of_sale/../tests/pos/tours/utils/product_screen_util"; +import {registry} from "@web/core/registry"; + +registry.category("web_tour.tours").add("pos_settle_due_deposit_money_tour", { + steps: () => + [ + Chrome.startPoS(), + Dialog.confirm("Open Register"), + ProductScreen.clickPartnerButton(), + PartnerList.clickPartnerOptions("C Partner"), + // The partner has a due invoice, so the settle option is there + PartnerList.checkDropDownItemText("Settle invoices"), + // Without this module the deposit option would be hidden + PartnerList.checkDropDownItemText("Deposit money"), + PartnerList.clickDropDownItemText("Deposit money"), + Dialog.is("Select the payment method to deposit money"), + Dialog.cancel(), + Chrome.endTour(), + ].flat(), +}); diff --git a/pos_settle_due_deposit_money/tests/__init__.py b/pos_settle_due_deposit_money/tests/__init__.py new file mode 100644 index 0000000000..9c2ae55709 --- /dev/null +++ b/pos_settle_due_deposit_money/tests/__init__.py @@ -0,0 +1 @@ +from . import test_pos_settle_due_deposit_money diff --git a/pos_settle_due_deposit_money/tests/test_pos_settle_due_deposit_money.py b/pos_settle_due_deposit_money/tests/test_pos_settle_due_deposit_money.py new file mode 100644 index 0000000000..a6eef03144 --- /dev/null +++ b/pos_settle_due_deposit_money/tests/test_pos_settle_due_deposit_money.py @@ -0,0 +1,36 @@ +# Copyright 2026 Jarsa +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +import odoo.tests + +from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon + + +@odoo.tests.tagged("post_install", "-at_install") +class TestPosSettleDueDepositMoney(TestPointOfSaleHttpCommon): + def test_deposit_money_with_due_invoice(self): + partner = self.env["res.partner"].create({"name": "C Partner"}) + invoice = self.env["account.move"].create( + { + "partner_id": partner.id, + "move_type": "out_invoice", + "invoice_line_ids": [(0, 0, {"name": "test", "price_unit": 100})], + } + ) + invoice.action_post() + self.assertEqual(partner.total_due, 100) + customer_account_pm = self.env["pos.payment.method"].create( + { + "name": "Customer Account", + "split_transactions": True, + } + ) + self.main_pos_config.write( + {"payment_method_ids": [(4, customer_account_pm.id)]} + ) + self.main_pos_config.open_ui() + self.start_tour( + "/pos/ui?config_id=%d" % self.main_pos_config.id, + "pos_settle_due_deposit_money_tour", + login="accountman", + )