From f386f7044792060de5cbca1c581ff8cabf8644d5 Mon Sep 17 00:00:00 2001 From: Antoni Marroig Campomar Date: Thu, 15 Aug 2024 12:53:06 +0200 Subject: [PATCH] [IMP] account_payment_order_notification: pre-commit auto fixes --- account_payment_order_notification/README.rst | 71 +++++++++++-------- .../models/account_payment_order.py | 2 +- .../account_payment_order_notification.py | 4 +- .../pyproject.toml | 3 + .../readme/CONFIGURE.md | 12 ++++ .../readme/CONFIGURE.rst | 11 --- .../readme/CONTRIBUTORS.md | 3 + .../readme/CONTRIBUTORS.rst | 4 -- .../readme/DESCRIPTION.md | 2 + .../readme/DESCRIPTION.rst | 1 - .../readme/USAGE.md | 16 +++++ .../readme/USAGE.rst | 11 --- .../static/description/index.html | 50 +++++++------ ...test_account_payment_order_notification.py | 2 +- ...zard_account_payment_order_notification.py | 5 +- 15 files changed, 110 insertions(+), 87 deletions(-) create mode 100644 account_payment_order_notification/pyproject.toml create mode 100644 account_payment_order_notification/readme/CONFIGURE.md delete mode 100644 account_payment_order_notification/readme/CONFIGURE.rst create mode 100644 account_payment_order_notification/readme/CONTRIBUTORS.md delete mode 100644 account_payment_order_notification/readme/CONTRIBUTORS.rst create mode 100644 account_payment_order_notification/readme/DESCRIPTION.md delete mode 100644 account_payment_order_notification/readme/DESCRIPTION.rst create mode 100644 account_payment_order_notification/readme/USAGE.md delete mode 100644 account_payment_order_notification/readme/USAGE.rst diff --git a/account_payment_order_notification/README.rst b/account_payment_order_notification/README.rst index ad29461b2..3332ed415 100644 --- a/account_payment_order_notification/README.rst +++ b/account_payment_order_notification/README.rst @@ -17,18 +17,19 @@ Account Payment Order Notification :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/16.0/account_payment_order_notification + :target: https://github.com/OCA/bank-payment/tree/17.0/account_payment_order_notification :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-16-0/bank-payment-16-0-account_payment_order_notification + :target: https://translation.odoo-community.org/projects/bank-payment-17-0/bank-payment-17-0-account_payment_order_notification :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/bank-payment&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module adds a button on debit / payment orders to send an email to each related partner with the details of their transactions. +This module adds a button on debit / payment orders to send an email to +each related partner with the details of their transactions. **Table of contents** @@ -40,30 +41,40 @@ Configuration To configure this module, you need to: -#. Go to *Invoicing > Configuration > Payment Modes* and create a payment mode, if you wish. +1. Go to *Invoicing > Configuration > Payment Modes* and create a + payment mode, if you wish. -#. Go to *Invoicing > Customers > Customers* and create a new record as follows: - * Name: Test customer 1 - * Email: customer1@test.com +2. Go to *Invoicing > Customers > Customers* and create a new record as + follows: -#. Go to *Invoicing > Customers > Customers* and create a new record as follows: - * Name: Test customer 2 - * Email: (empty) + - Name: Test customer 1 + - Email: customer1@test.com + +3. Go to *Invoicing > Customers > Customers* and create a new record as + follows: + + - Name: Test customer 2 + - Email: (empty) Usage ===== -#. Go to *Invoicing > Customers > Invoices* and create one or more invoices linked to the payment mode. -#. Go to *Invoicing > Customers > Invoices* select the invoices created and execute the action called "Post entries". -#. Go to *Invoicing > Customers > Invoices* select the invoices created and execute the action called "Add to Payment/Debit Order" and create a payment order. -#. Click on "Confirm Payments" button. -#. Click on "Generate Payment File" button. -#. Click on "File Successfully Uploaded" button. -#. Click on "Send mails" button. -#. Any involved partner with no email will appear with the column "To send" not checked. -#. Click on "Confirm" button. -#. An email will have been sent to the selected partners. -#. A reminder note will have been created. +1. Go to *Invoicing > Customers > Invoices* and create one or more + invoices linked to the payment mode. +2. Go to *Invoicing > Customers > Invoices* select the invoices created + and execute the action called "Post entries". +3. Go to *Invoicing > Customers > Invoices* select the invoices created + and execute the action called "Add to Payment/Debit Order" and + create a payment order. +4. Click on "Confirm Payments" button. +5. Click on "Generate Payment File" button. +6. Click on "File Successfully Uploaded" button. +7. Click on "Send mails" button. +8. Any involved partner with no email will appear with the column "To + send" not checked. +9. Click on "Confirm" button. +10. An email will have been sent to the selected partners. +11. A reminder note will have been created. Bug Tracker =========== @@ -71,7 +82,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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -79,20 +90,20 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Víctor Martínez - * Pedro M. Baeza + - Víctor Martínez + - Pedro M. Baeza Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -112,6 +123,6 @@ Current `maintainer `__: |maintainer-victoralmau| -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_payment_order_notification/models/account_payment_order.py b/account_payment_order_notification/models/account_payment_order.py index 912a90080..12596db56 100644 --- a/account_payment_order_notification/models/account_payment_order.py +++ b/account_payment_order_notification/models/account_payment_order.py @@ -26,7 +26,7 @@ class AccountPaymentOrder(models.Model): def action_view_notifications(self): self.ensure_one() - xml_id = "%s.%s" % ( + xml_id = "{}.{}".format( "account_payment_order_notification", "account_payment_order_notification_action", ) diff --git a/account_payment_order_notification/models/account_payment_order_notification.py b/account_payment_order_notification/models/account_payment_order_notification.py index a2ca5b54f..b8121a907 100644 --- a/account_payment_order_notification/models/account_payment_order_notification.py +++ b/account_payment_order_notification/models/account_payment_order_notification.py @@ -29,9 +29,7 @@ class AccountPaymentOrderNotification(models.Model): @api.depends("order_id", "partner_id") def _compute_display_name(self): for item in self: - item.display_name = "[{}] {}".format( - item.order_id.name, item.partner_id.display_name - ) + item.display_name = f"[{item.order_id.name}] {item.partner_id.display_name}" @api.model_create_multi def create(self, vals_list): diff --git a/account_payment_order_notification/pyproject.toml b/account_payment_order_notification/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/account_payment_order_notification/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_payment_order_notification/readme/CONFIGURE.md b/account_payment_order_notification/readme/CONFIGURE.md new file mode 100644 index 000000000..bb313ed11 --- /dev/null +++ b/account_payment_order_notification/readme/CONFIGURE.md @@ -0,0 +1,12 @@ +To configure this module, you need to: + +1. Go to *Invoicing \> Configuration \> Payment Modes* and create a + payment mode, if you wish. + +2. Go to *Invoicing \> Customers \> Customers* and create a new record as follows: + - Name: Test customer 1 + - Email: + +3. Go to *Invoicing \> Customers \> Customers* and create a new record as follows: + - Name: Test customer 2 + - Email: (empty) diff --git a/account_payment_order_notification/readme/CONFIGURE.rst b/account_payment_order_notification/readme/CONFIGURE.rst deleted file mode 100644 index eca598c8e..000000000 --- a/account_payment_order_notification/readme/CONFIGURE.rst +++ /dev/null @@ -1,11 +0,0 @@ -To configure this module, you need to: - -#. Go to *Invoicing > Configuration > Payment Modes* and create a payment mode, if you wish. - -#. Go to *Invoicing > Customers > Customers* and create a new record as follows: - * Name: Test customer 1 - * Email: customer1@test.com - -#. Go to *Invoicing > Customers > Customers* and create a new record as follows: - * Name: Test customer 2 - * Email: (empty) diff --git a/account_payment_order_notification/readme/CONTRIBUTORS.md b/account_payment_order_notification/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..5fee39042 --- /dev/null +++ b/account_payment_order_notification/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Tecnativa](https://www.tecnativa.com): + - Víctor Martínez + - Pedro M. Baeza diff --git a/account_payment_order_notification/readme/CONTRIBUTORS.rst b/account_payment_order_notification/readme/CONTRIBUTORS.rst deleted file mode 100644 index 5fb713053..000000000 --- a/account_payment_order_notification/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,4 +0,0 @@ -* `Tecnativa `_: - - * Víctor Martínez - * Pedro M. Baeza diff --git a/account_payment_order_notification/readme/DESCRIPTION.md b/account_payment_order_notification/readme/DESCRIPTION.md new file mode 100644 index 000000000..7627451a4 --- /dev/null +++ b/account_payment_order_notification/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module adds a button on debit / payment orders to send an email to +each related partner with the details of their transactions. diff --git a/account_payment_order_notification/readme/DESCRIPTION.rst b/account_payment_order_notification/readme/DESCRIPTION.rst deleted file mode 100644 index 88fb038fe..000000000 --- a/account_payment_order_notification/readme/DESCRIPTION.rst +++ /dev/null @@ -1 +0,0 @@ -This module adds a button on debit / payment orders to send an email to each related partner with the details of their transactions. diff --git a/account_payment_order_notification/readme/USAGE.md b/account_payment_order_notification/readme/USAGE.md new file mode 100644 index 000000000..16ac7d867 --- /dev/null +++ b/account_payment_order_notification/readme/USAGE.md @@ -0,0 +1,16 @@ +1. Go to *Invoicing \> Customers \> Invoices* and create one or more + invoices linked to the payment mode. +2. Go to *Invoicing \> Customers \> Invoices* select the invoices + created and execute the action called "Post entries". +3. Go to *Invoicing \> Customers \> Invoices* select the invoices + created and execute the action called "Add to Payment/Debit Order" + and create a payment order. +4. Click on "Confirm Payments" button. +5. Click on "Generate Payment File" button. +6. Click on "File Successfully Uploaded" button. +7. Click on "Send mails" button. +8. Any involved partner with no email will appear with the column "To + send" not checked. +9. Click on "Confirm" button. +10. An email will have been sent to the selected partners. +11. A reminder note will have been created. diff --git a/account_payment_order_notification/readme/USAGE.rst b/account_payment_order_notification/readme/USAGE.rst deleted file mode 100644 index 433a8a2ff..000000000 --- a/account_payment_order_notification/readme/USAGE.rst +++ /dev/null @@ -1,11 +0,0 @@ -#. Go to *Invoicing > Customers > Invoices* and create one or more invoices linked to the payment mode. -#. Go to *Invoicing > Customers > Invoices* select the invoices created and execute the action called "Post entries". -#. Go to *Invoicing > Customers > Invoices* select the invoices created and execute the action called "Add to Payment/Debit Order" and create a payment order. -#. Click on "Confirm Payments" button. -#. Click on "Generate Payment File" button. -#. Click on "File Successfully Uploaded" button. -#. Click on "Send mails" button. -#. Any involved partner with no email will appear with the column "To send" not checked. -#. Click on "Confirm" button. -#. An email will have been sent to the selected partners. -#. A reminder note will have been created. diff --git a/account_payment_order_notification/static/description/index.html b/account_payment_order_notification/static/description/index.html index 2da544b8c..c8cdc7302 100644 --- a/account_payment_order_notification/static/description/index.html +++ b/account_payment_order_notification/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,8 +369,9 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:e5ad04ecc8cfa4d7eef0547b8b8a62a83f7906228b463c1cf7f1029e8d555a42 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/bank-payment Translate me on Weblate Try me on Runboat

-

This module adds a button on debit / payment orders to send an email to each related partner with the details of their transactions.

+

Beta License: AGPL-3 OCA/bank-payment Translate me on Weblate Try me on Runboat

+

This module adds a button on debit / payment orders to send an email to +each related partner with the details of their transactions.

Table of contents

    @@ -388,38 +390,38 @@ ul.auto-toc {

    Configuration

    To configure this module, you need to:

      -
    1. Go to Invoicing > Configuration > Payment Modes and create a payment mode, if you wish.
    2. -
    3. -
      Go to Invoicing > Customers > Customers and create a new record as follows:
      -
        +
      • Go to Invoicing > Configuration > Payment Modes and create a +payment mode, if you wish.
      • +
      • Go to Invoicing > Customers > Customers and create a new record as +follows: -
      -
    4. -
    5. -
      Go to Invoicing > Customers > Customers and create a new record as follows:
      -
        +
      • Go to Invoicing > Customers > Customers and create a new record as +follows:
        • Name: Test customer 2
        • Email: (empty)
        -
      -

Usage

    -
  1. Go to Invoicing > Customers > Invoices and create one or more invoices linked to the payment mode.
  2. -
  3. Go to Invoicing > Customers > Invoices select the invoices created and execute the action called “Post entries”.
  4. -
  5. Go to Invoicing > Customers > Invoices select the invoices created and execute the action called “Add to Payment/Debit Order” and create a payment order.
  6. +
  7. Go to Invoicing > Customers > Invoices and create one or more +invoices linked to the payment mode.
  8. +
  9. Go to Invoicing > Customers > Invoices select the invoices created +and execute the action called “Post entries”.
  10. +
  11. Go to Invoicing > Customers > Invoices select the invoices created +and execute the action called “Add to Payment/Debit Order” and +create a payment order.
  12. Click on “Confirm Payments” button.
  13. Click on “Generate Payment File” button.
  14. Click on “File Successfully Uploaded” button.
  15. Click on “Send mails” button.
  16. -
  17. Any involved partner with no email will appear with the column “To send” not checked.
  18. +
  19. Any involved partner with no email will appear with the column “To +send” not checked.
  20. Click on “Confirm” button.
  21. An email will have been sent to the selected partners.
  22. A reminder note will have been created.
  23. @@ -430,7 +432,7 @@ ul.auto-toc {

    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.

    +feedback.

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

@@ -454,13 +456,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +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.

Current maintainer:

victoralmau

-

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_payment_order_notification/tests/test_account_payment_order_notification.py b/account_payment_order_notification/tests/test_account_payment_order_notification.py index 43dec6678..5a8e82bdd 100644 --- a/account_payment_order_notification/tests/test_account_payment_order_notification.py +++ b/account_payment_order_notification/tests/test_account_payment_order_notification.py @@ -58,7 +58,7 @@ class TestAccountPaymentOrderNotification(TransactionCase): res = wizard.run() payment_order = self.env[res["res_model"]].browse(res["res_id"]) old_messages = payment_order.message_ids - template_xml_id = "%s.%s" % ( + template_xml_id = "{}.{}".format( "account_payment_order_notification", "email_account_payment_order_notification", ) diff --git a/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py b/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py index c3acf7752..9ba7d62e9 100644 --- a/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py +++ b/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py @@ -48,7 +48,7 @@ class WizardAccountPaymentOrderNotification(models.TransientModel): }, ) ] - template_xml_id = "%s.%s" % ( + template_xml_id = "{}.{}".format( "account_payment_order_notification", "email_account_payment_order_notification", ) @@ -65,7 +65,8 @@ class WizardAccountPaymentOrderNotification(models.TransientModel): notifications = [] for item in self.line_ids.filtered("to_send"): payment_line_ids = self.order_id.payment_line_ids.filtered( - lambda x: x.partner_id == item.partner_id.commercial_partner_id + lambda x, item=item: x.partner_id + == item.partner_id.commercial_partner_id ) data = { "partner_id": item.partner_id.id,