From b9b41e07b5fa38f0e9c6059c8c2665f08282c81d Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Thu, 18 Jun 2020 09:05:49 +0200 Subject: [PATCH 1/4] ADD 13.0 account_invoice_select_for_payment 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. --- account_invoice_select_for_payment/README.rst | 93 ++++ .../__init__.py | 1 + .../__manifest__.py | 15 + .../models/__init__.py | 2 + .../models/account_move.py | 18 + .../models/account_payment.py | 17 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 4 + .../readme/USAGE.rst | 10 + .../static/description/index.html | 437 ++++++++++++++++++ .../views/account_move.xml | 36 ++ 11 files changed, 634 insertions(+) create mode 100644 account_invoice_select_for_payment/README.rst create mode 100644 account_invoice_select_for_payment/__init__.py create mode 100644 account_invoice_select_for_payment/__manifest__.py create mode 100644 account_invoice_select_for_payment/models/__init__.py create mode 100644 account_invoice_select_for_payment/models/account_move.py create mode 100644 account_invoice_select_for_payment/models/account_payment.py create mode 100644 account_invoice_select_for_payment/readme/CONTRIBUTORS.rst create mode 100644 account_invoice_select_for_payment/readme/DESCRIPTION.rst create mode 100644 account_invoice_select_for_payment/readme/USAGE.rst create mode 100644 account_invoice_select_for_payment/static/description/index.html create mode 100644 account_invoice_select_for_payment/views/account_move.xml diff --git a/account_invoice_select_for_payment/README.rst b/account_invoice_select_for_payment/README.rst new file mode 100644 index 000000000..e6f37061d --- /dev/null +++ b/account_invoice_select_for_payment/README.rst @@ -0,0 +1,93 @@ +================================== +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/13.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-13-0/bank-payment-13-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/13.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 + +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..57dbaf94f --- /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": "13.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/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..8785f72c0 --- /dev/null +++ b/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Alexandre Fayolle 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/index.html b/account_invoice_select_for_payment/static/description/index.html new file mode 100644 index 000000000..83c2d0961 --- /dev/null +++ b/account_invoice_select_for_payment/static/description/index.html @@ -0,0 +1,437 @@ + + + + + + +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

+ +
+
+

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..c6e2f866b --- /dev/null +++ b/account_invoice_select_for_payment/views/account_move.xml @@ -0,0 +1,36 @@ + + + + account.move + + + + + + + + + account.move.select + account.move + + + + + + + + + + From f36d969d8c3795b229d880f1ed582fc48b1694b7 Mon Sep 17 00:00:00 2001 From: Tran Thanh Phuc Date: Sun, 20 Dec 2020 21:08:04 +0700 Subject: [PATCH 2/4] [MIG] account_invoice_select_for_payment: Migration to 14.0 --- account_invoice_select_for_payment/README.rst | 24 ++++++++++++----- .../__manifest__.py | 2 +- .../readme/CONTRIBUTORS.rst | 1 + .../readme/CREDITS.rst | 3 +++ .../static/description/index.html | 26 ++++++++++++++----- .../views/account_move.xml | 2 +- 6 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 account_invoice_select_for_payment/readme/CREDITS.rst diff --git a/account_invoice_select_for_payment/README.rst b/account_invoice_select_for_payment/README.rst index e6f37061d..78d503f9b 100644 --- a/account_invoice_select_for_payment/README.rst +++ b/account_invoice_select_for_payment/README.rst @@ -14,19 +14,21 @@ Account Invoice Select for Payment :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/13.0/account_invoice_select_for_payment + :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-13-0/bank-payment-13-0-account_invoice_select_for_payment + :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/13.0 + :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. - +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. @@ -58,7 +60,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -74,6 +76,14 @@ Contributors ~~~~~~~~~~~~ * Alexandre Fayolle +* Hiep Nguyen Hoang + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Camptocamp Maintainers ~~~~~~~~~~~ @@ -88,6 +98,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/bank-payment `_ project on GitHub. +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/__manifest__.py b/account_invoice_select_for_payment/__manifest__.py index 57dbaf94f..b2fe9f1d3 100644 --- a/account_invoice_select_for_payment/__manifest__.py +++ b/account_invoice_select_for_payment/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Account Invoice Select for Payment", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "license": "AGPL-3", "author": "Camptocamp,Odoo Community Association (OCA)", "website": "https://github.com/OCA/bank-payment", diff --git a/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst b/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst index 8785f72c0..70e7e97f3 100644 --- a/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst +++ b/account_invoice_select_for_payment/readme/CONTRIBUTORS.rst @@ -1 +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/static/description/index.html b/account_invoice_select_for_payment/static/description/index.html index 83c2d0961..532495016 100644 --- a/account_invoice_select_for_payment/static/description/index.html +++ b/account_invoice_select_for_payment/static/description/index.html @@ -3,7 +3,7 @@ - + Account Invoice Select for Payment