diff --git a/account_invoice_select_for_payment/README.rst b/account_invoice_select_for_payment/README.rst new file mode 100644 index 000000000..78d503f9b --- /dev/null +++ b/account_invoice_select_for_payment/README.rst @@ -0,0 +1,103 @@ +================================== +Account Invoice Select for Payment +================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |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%2Fbank--payment-lightgray.png?logo=github + :target: https://github.com/OCA/bank-payment/tree/14.0/account_invoice_select_for_payment + :alt: OCA/bank-payment +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/bank-payment-14-0/bank-payment-14-0-account_invoice_select_for_payment + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/173/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to mark invoices as "selected for payment". This can be done +in the list view of invoices using a button in the first column of the view +which shows the selection status. This selection persists until a payment is +registered. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To mark an invoice as "selected for payment", click on the button before the +Number column. This will change the state and change the way the button is +displayed to a checked box. + +When done, use the search filter "Selected for payment", and select all the +lines to give access to the Actions menu, in which you can select "Register +payment" to display the Payment wizard. + +The selection is cleared when the wizard is displayed, whether the payment is +done or not. + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Alexandre Fayolle +* Hiep Nguyen Hoang + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Camptocamp + +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/bank-payment `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_invoice_select_for_payment/__init__.py b/account_invoice_select_for_payment/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/account_invoice_select_for_payment/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/account_invoice_select_for_payment/__manifest__.py b/account_invoice_select_for_payment/__manifest__.py new file mode 100644 index 000000000..b2fe9f1d3 --- /dev/null +++ b/account_invoice_select_for_payment/__manifest__.py @@ -0,0 +1,15 @@ +# © 2016 Akretion (). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Account Invoice Select for Payment", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "author": "Camptocamp,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/bank-payment", + "category": "Banking addons", + "depends": ["account"], + "data": ["views/account_move.xml"], + "development_status": "Alpha", + "installable": True, +} diff --git a/account_invoice_select_for_payment/i18n/account_invoice_select_for_payment.pot b/account_invoice_select_for_payment/i18n/account_invoice_select_for_payment.pot new file mode 100644 index 000000000..e8d929108 --- /dev/null +++ b/account_invoice_select_for_payment/i18n/account_invoice_select_for_payment.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_invoice_select_for_payment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_invoice_select_for_payment +#: model:ir.model,name:account_invoice_select_for_payment.model_account_move +msgid "Journal Entries" +msgstr "" + +#. module: account_invoice_select_for_payment +#: model_terms:ir.ui.view,arch_db:account_invoice_select_for_payment.view_account_invoice_filter +msgid "Not selected for payment" +msgstr "" + +#. module: account_invoice_select_for_payment +#: model:ir.model,name:account_invoice_select_for_payment.model_account_payment +msgid "Payments" +msgstr "" + +#. module: account_invoice_select_for_payment +#: model_terms:ir.ui.view,arch_db:account_invoice_select_for_payment.view_account_invoice_filter +msgid "Selected for payment" +msgstr "" + +#. module: account_invoice_select_for_payment +#: model:ir.model.fields,field_description:account_invoice_select_for_payment.field_account_move__selected_for_payment +msgid "To Pay" +msgstr "" diff --git a/account_invoice_select_for_payment/models/__init__.py b/account_invoice_select_for_payment/models/__init__.py new file mode 100644 index 000000000..11623d4e5 --- /dev/null +++ b/account_invoice_select_for_payment/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_move +from . import account_payment diff --git a/account_invoice_select_for_payment/models/account_move.py b/account_invoice_select_for_payment/models/account_move.py new file mode 100644 index 000000000..de2632c60 --- /dev/null +++ b/account_invoice_select_for_payment/models/account_move.py @@ -0,0 +1,18 @@ +# Copyright 2020 Camptocamp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountMove(models.Model): + _inherit = "account.move" + + selected_for_payment = fields.Boolean("To Pay") + + def action_toggle_select_for_payment(self): + selected = self.filtered(lambda rec: rec.selected_for_payment) + unselected = self - selected + if selected: + selected.write({"selected_for_payment": False}) + if unselected: + unselected.write({"selected_for_payment": True}) diff --git a/account_invoice_select_for_payment/models/account_payment.py b/account_invoice_select_for_payment/models/account_payment.py new file mode 100644 index 000000000..113e19721 --- /dev/null +++ b/account_invoice_select_for_payment/models/account_payment.py @@ -0,0 +1,17 @@ +# Copyright 2020 Camptocamp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class AccountPayment(models.Model): + _inherit = "account.payment" + + def action_register_payment(self): + active_ids = self.env.context.get("active_ids") + if active_ids: + invoices = self.env["account.move"].search( + [("id", "in", active_ids), ("selected_for_payment", "=", True)] + ) + invoices.write({"selected_for_payment": False}) + return super().action_register_payment() diff --git a/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst b/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..70e7e97f3 --- /dev/null +++ b/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Alexandre Fayolle +* Hiep Nguyen Hoang diff --git a/account_invoice_select_for_payment/readme/CREDITS.rst b/account_invoice_select_for_payment/readme/CREDITS.rst new file mode 100644 index 000000000..f5cc070c7 --- /dev/null +++ b/account_invoice_select_for_payment/readme/CREDITS.rst @@ -0,0 +1,3 @@ +The development of this module has been financially supported by: + +* Camptocamp diff --git a/account_invoice_select_for_payment/readme/DESCRIPTION.rst b/account_invoice_select_for_payment/readme/DESCRIPTION.rst new file mode 100644 index 000000000..626cc4d3f --- /dev/null +++ b/account_invoice_select_for_payment/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module allows to mark invoices as "selected for payment". This can be done +in the list view of invoices using a button in the first column of the view +which shows the selection status. This selection persists until a payment is +registered. diff --git a/account_invoice_select_for_payment/readme/USAGE.rst b/account_invoice_select_for_payment/readme/USAGE.rst new file mode 100644 index 000000000..1a624cf83 --- /dev/null +++ b/account_invoice_select_for_payment/readme/USAGE.rst @@ -0,0 +1,10 @@ +To mark an invoice as "selected for payment", click on the button before the +Number column. This will change the state and change the way the button is +displayed to a checked box. + +When done, use the search filter "Selected for payment", and select all the +lines to give access to the Actions menu, in which you can select "Register +payment" to display the Payment wizard. + +The selection is cleared when the wizard is displayed, whether the payment is +done or not. diff --git a/account_invoice_select_for_payment/static/description/icon.png b/account_invoice_select_for_payment/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/account_invoice_select_for_payment/static/description/icon.png differ diff --git a/account_invoice_select_for_payment/static/description/index.html b/account_invoice_select_for_payment/static/description/index.html new file mode 100644 index 000000000..532495016 --- /dev/null +++ b/account_invoice_select_for_payment/static/description/index.html @@ -0,0 +1,449 @@ + + + + + + +Account Invoice Select for Payment + + + +
+

Account Invoice Select for Payment

+ + +

Alpha License: AGPL-3 OCA/bank-payment Translate me on Weblate Try me on Runbot

+

This module allows to mark invoices as “selected for payment”. This can be done +in the list view of invoices using a button in the first column of the view +which shows the selection status. This selection persists until a payment is +registered.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Usage

+

To mark an invoice as “selected for payment”, click on the button before the +Number column. This will change the state and change the way the button is +displayed to a checked box.

+

When done, use the search filter “Selected for payment”, and select all the +lines to give access to the Actions menu, in which you can select “Register +payment” to display the Payment wizard.

+

The selection is cleared when the wizard is displayed, whether the payment is +done or not.

+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • Camptocamp
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/account_invoice_select_for_payment/views/account_move.xml b/account_invoice_select_for_payment/views/account_move.xml new file mode 100644 index 000000000..7b486fb3a --- /dev/null +++ b/account_invoice_select_for_payment/views/account_move.xml @@ -0,0 +1,36 @@ + + + + account.move + + + + + + + + + account.move.select + account.move + + + + + + + + + +