From 0b245670bb9e0dfa9777fc0aa944e8b4149656c9 Mon Sep 17 00:00:00 2001 From: miguel-S73 Date: Wed, 14 Aug 2024 18:17:54 +0200 Subject: [PATCH] [IMP] sale_global_discount: pre-commit auto fixes --- sale_global_discount/README.rst | 56 ++++++++++--------- sale_global_discount/models/sale_order.py | 11 ++-- sale_global_discount/pyproject.toml | 3 + .../readme/{CONFIGURE.rst => CONFIGURE.md} | 3 +- sale_global_discount/readme/CONTRIBUTORS.md | 4 ++ sale_global_discount/readme/CONTRIBUTORS.rst | 5 -- .../{DESCRIPTION.rst => DESCRIPTION.md} | 4 +- sale_global_discount/readme/ROADMAP.md | 3 + sale_global_discount/readme/ROADMAP.rst | 3 - sale_global_discount/readme/USAGE.md | 11 ++++ sale_global_discount/readme/USAGE.rst | 10 ---- .../static/description/index.html | 44 ++++++++------- 12 files changed, 87 insertions(+), 70 deletions(-) create mode 100644 sale_global_discount/pyproject.toml rename sale_global_discount/readme/{CONFIGURE.rst => CONFIGURE.md} (65%) create mode 100644 sale_global_discount/readme/CONTRIBUTORS.md delete mode 100644 sale_global_discount/readme/CONTRIBUTORS.rst rename sale_global_discount/readme/{DESCRIPTION.rst => DESCRIPTION.md} (68%) create mode 100644 sale_global_discount/readme/ROADMAP.md delete mode 100644 sale_global_discount/readme/ROADMAP.rst create mode 100644 sale_global_discount/readme/USAGE.md delete mode 100644 sale_global_discount/readme/USAGE.rst diff --git a/sale_global_discount/README.rst b/sale_global_discount/README.rst index 0d9dfca867e0..a460bd6fd97c 100644 --- a/sale_global_discount/README.rst +++ b/sale_global_discount/README.rst @@ -17,19 +17,19 @@ Sale Global Discount :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github - :target: https://github.com/OCA/sale-workflow/tree/16.0/sale_global_discount + :target: https://github.com/OCA/sale-workflow/tree/17.0/sale_global_discount :alt: OCA/sale-workflow .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_global_discount + :target: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_global_discount :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/sale-workflow&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -Apply global financial discounts to sales that will be transmited to invoices -and accounting. +Apply global financial discounts to sales that will be transmited to +invoices and accounting. **Table of contents** @@ -39,28 +39,31 @@ and accounting. Configuration ============= -To configure this module please refer to configure section of the `base_global_discount` module. +To configure this module please refer to configure section of the +base_global_discount module. Usage ===== To use this module, you need to: -#. See usage section of the `base_global_discount` module. -#. Create a new sale order and choose a partner. -#. If the partner has customer global discounts set, those will be applied to - the order by default. -#. Otherwise, you can set them manually from the header of the sale order. -#. In the order footer, you can see the computed discounts. -#. When you create an invoice from the order, the proper global discounts will - be applied on it. +1. See usage section of the base_global_discount module. +2. Create a new sale order and choose a partner. +3. If the partner has customer global discounts set, those will be + applied to the order by default. +4. Otherwise, you can set them manually from the header of the sale + order. +5. In the order footer, you can see the computed discounts. +6. When you create an invoice from the order, the proper global + discounts will be applied on it. Known issues / Roadmap ====================== -* Not all the taxes combination can be compatible with global discounts. An - error is raised in that cases. -* Currently, taxes in invoice lines are mandatory with global discounts. +- Not all the taxes combination can be compatible with global + discounts. An error is raised in that cases. +- Currently, taxes in invoice lines are mandatory with global + discounts. Bug Tracker =========== @@ -68,7 +71,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. @@ -76,21 +79,22 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_ +- `Tecnativa `__ - * David Vidal - * Pedro M. Baeza -* Omar Castiñeira + - David Vidal + - Pedro M. Baeza + +- Omar Castiñeira Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -102,6 +106,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/sale-workflow `_ project on GitHub. +This module is part of the `OCA/sale-workflow `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_global_discount/models/sale_order.py b/sale_global_discount/models/sale_order.py index 513c52e1d5f4..fc66211ddb16 100644 --- a/sale_global_discount/models/sale_order.py +++ b/sale_global_discount/models/sale_order.py @@ -141,10 +141,13 @@ def _compute_tax_totals(self): @api.onchange("partner_id") def onchange_partner_id_set_gbl_disc(self): - self.global_discount_ids = self.partner_id.customer_global_discount_ids.filtered( - lambda d: d.company_id == self.company_id - ) or self.partner_id.commercial_partner_id.customer_global_discount_ids.filtered( - lambda d: d.company_id == self.company_id + self.global_discount_ids = ( + self.partner_id.customer_global_discount_ids.filtered( + lambda d: d.company_id == self.company_id + ) + or self.partner_id.commercial_partner_id.customer_global_discount_ids.filtered( + lambda d: d.company_id == self.company_id + ) ) def _prepare_invoice(self): diff --git a/sale_global_discount/pyproject.toml b/sale_global_discount/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/sale_global_discount/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_global_discount/readme/CONFIGURE.rst b/sale_global_discount/readme/CONFIGURE.md similarity index 65% rename from sale_global_discount/readme/CONFIGURE.rst rename to sale_global_discount/readme/CONFIGURE.md index 897d76f1bcfa..642811a4821b 100644 --- a/sale_global_discount/readme/CONFIGURE.rst +++ b/sale_global_discount/readme/CONFIGURE.md @@ -1 +1,2 @@ -To configure this module please refer to configure section of the `base_global_discount` module. +To configure this module please refer to configure section of the +base_global_discount module. diff --git a/sale_global_discount/readme/CONTRIBUTORS.md b/sale_global_discount/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..17320ded8376 --- /dev/null +++ b/sale_global_discount/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- [Tecnativa](https://www.tecnativa.com) + - David Vidal + - Pedro M. Baeza +- Omar Castiñeira \<\> diff --git a/sale_global_discount/readme/CONTRIBUTORS.rst b/sale_global_discount/readme/CONTRIBUTORS.rst deleted file mode 100644 index b1fa5e3437d7..000000000000 --- a/sale_global_discount/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,5 +0,0 @@ -* `Tecnativa `_ - - * David Vidal - * Pedro M. Baeza -* Omar Castiñeira diff --git a/sale_global_discount/readme/DESCRIPTION.rst b/sale_global_discount/readme/DESCRIPTION.md similarity index 68% rename from sale_global_discount/readme/DESCRIPTION.rst rename to sale_global_discount/readme/DESCRIPTION.md index 10a4a0538f4e..b33973639bc1 100644 --- a/sale_global_discount/readme/DESCRIPTION.rst +++ b/sale_global_discount/readme/DESCRIPTION.md @@ -1,2 +1,2 @@ -Apply global financial discounts to sales that will be transmited to invoices -and accounting. +Apply global financial discounts to sales that will be transmited to +invoices and accounting. diff --git a/sale_global_discount/readme/ROADMAP.md b/sale_global_discount/readme/ROADMAP.md new file mode 100644 index 000000000000..9d09cf969ae1 --- /dev/null +++ b/sale_global_discount/readme/ROADMAP.md @@ -0,0 +1,3 @@ +- Not all the taxes combination can be compatible with global discounts. + An error is raised in that cases. +- Currently, taxes in invoice lines are mandatory with global discounts. diff --git a/sale_global_discount/readme/ROADMAP.rst b/sale_global_discount/readme/ROADMAP.rst deleted file mode 100644 index 8e5c2e79bc86..000000000000 --- a/sale_global_discount/readme/ROADMAP.rst +++ /dev/null @@ -1,3 +0,0 @@ -* Not all the taxes combination can be compatible with global discounts. An - error is raised in that cases. -* Currently, taxes in invoice lines are mandatory with global discounts. diff --git a/sale_global_discount/readme/USAGE.md b/sale_global_discount/readme/USAGE.md new file mode 100644 index 000000000000..c550c20c9c1d --- /dev/null +++ b/sale_global_discount/readme/USAGE.md @@ -0,0 +1,11 @@ +To use this module, you need to: + +1. See usage section of the base_global_discount module. +2. Create a new sale order and choose a partner. +3. If the partner has customer global discounts set, those will be + applied to the order by default. +4. Otherwise, you can set them manually from the header of the sale + order. +5. In the order footer, you can see the computed discounts. +6. When you create an invoice from the order, the proper global + discounts will be applied on it. diff --git a/sale_global_discount/readme/USAGE.rst b/sale_global_discount/readme/USAGE.rst deleted file mode 100644 index fc02f111d914..000000000000 --- a/sale_global_discount/readme/USAGE.rst +++ /dev/null @@ -1,10 +0,0 @@ -To use this module, you need to: - -#. See usage section of the `base_global_discount` module. -#. Create a new sale order and choose a partner. -#. If the partner has customer global discounts set, those will be applied to - the order by default. -#. Otherwise, you can set them manually from the header of the sale order. -#. In the order footer, you can see the computed discounts. -#. When you create an invoice from the order, the proper global discounts will - be applied on it. diff --git a/sale_global_discount/static/description/index.html b/sale_global_discount/static/description/index.html index 7f8be0d34662..9bc8303c2993 100644 --- a/sale_global_discount/static/description/index.html +++ b/sale_global_discount/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 @@ 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.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,9 +369,9 @@

Sale Global Discount

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:308d1f4b778a286e7914857091bbaa912e44faf68ffe5678f48c8bfe6f52168a !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

-

Apply global financial discounts to sales that will be transmited to invoices -and accounting.

+

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

+

Apply global financial discounts to sales that will be transmited to +invoices and accounting.

Table of contents

    @@ -388,28 +389,31 @@

    Sale Global Discount

Configuration

-

To configure this module please refer to configure section of the base_global_discount module.

+

To configure this module please refer to configure section of the +base_global_discount module.

Usage

To use this module, you need to:

    -
  1. See usage section of the base_global_discount module.
  2. +
  3. See usage section of the base_global_discount module.
  4. Create a new sale order and choose a partner.
  5. -
  6. If the partner has customer global discounts set, those will be applied to -the order by default.
  7. -
  8. Otherwise, you can set them manually from the header of the sale order.
  9. +
  10. If the partner has customer global discounts set, those will be +applied to the order by default.
  11. +
  12. Otherwise, you can set them manually from the header of the sale +order.
  13. In the order footer, you can see the computed discounts.
  14. -
  15. When you create an invoice from the order, the proper global discounts will -be applied on it.
  16. +
  17. When you create an invoice from the order, the proper global +discounts will be applied on it.

Known issues / Roadmap

    -
  • Not all the taxes combination can be compatible with global discounts. An -error is raised in that cases.
  • -
  • Currently, taxes in invoice lines are mandatory with global discounts.
  • +
  • Not all the taxes combination can be compatible with global +discounts. An error is raised in that cases.
  • +
  • Currently, taxes in invoice lines are mandatory with global +discounts.
@@ -417,7 +421,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.

@@ -442,11 +446,13 @@

Contributors

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.

-

This module is part of the OCA/sale-workflow project on GitHub.

+

This module is part of the OCA/sale-workflow project on GitHub.

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