From df1331c8aae07f6911d2761577b63408a22b4ef7 Mon Sep 17 00:00:00 2001 From: David Jaen Date: Tue, 7 May 2024 13:46:18 +0200 Subject: [PATCH] [IMP] product_contract: pre-commit auto fixes --- product_contract/README.rst | 41 ++++++++++--------- product_contract/models/res_company.py | 1 - .../models/res_config_settings.py | 1 - product_contract/models/sale_order.py | 4 +- product_contract/pyproject.toml | 3 ++ product_contract/readme/CONTRIBUTORS.md | 5 +++ product_contract/readme/CONTRIBUTORS.rst | 6 --- product_contract/readme/DESCRIPTION.md | 8 ++++ product_contract/readme/DESCRIPTION.rst | 5 --- product_contract/readme/USAGE.md | 6 +++ product_contract/readme/USAGE.rst | 6 --- .../static/description/index.html | 27 +++++++----- requirements.txt | 2 + 13 files changed, 63 insertions(+), 52 deletions(-) create mode 100644 product_contract/pyproject.toml create mode 100644 product_contract/readme/CONTRIBUTORS.md delete mode 100644 product_contract/readme/CONTRIBUTORS.rst create mode 100644 product_contract/readme/DESCRIPTION.md delete mode 100644 product_contract/readme/DESCRIPTION.rst create mode 100644 product_contract/readme/USAGE.md delete mode 100644 product_contract/readme/USAGE.rst create mode 100644 requirements.txt diff --git a/product_contract/README.rst b/product_contract/README.rst index 28989716d..68d049ae3 100644 --- a/product_contract/README.rst +++ b/product_contract/README.rst @@ -17,22 +17,25 @@ Recurring - Product Contract :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github - :target: https://github.com/OCA/contract/tree/16.0/product_contract + :target: https://github.com/OCA/contract/tree/17.0/product_contract :alt: OCA/contract .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/contract-16-0/contract-16-0-product_contract + :target: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-product_contract :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/contract&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module adds support for products to be linked to contract templates. +This module adds support for products to be linked to contract +templates. -A contract is created on ``sale.order`` confirmation for each different template used in sale order line where recurrence details are set too. +A contract is created on ``sale.order`` confirmation for each different +template used in sale order line where recurrence details are set too. -Contract product are ignored on invoicing process and pass to nothing to invoice directly. +Contract product are ignored on invoicing process and pass to nothing to +invoice directly. **Table of contents** @@ -44,10 +47,10 @@ Usage To use this module, you need to: -#. Go to Sales -> Products and select or create a product. -#. Check "Is a contract" and select the contract template related to the +1. Go to Sales -> Products and select or create a product. +2. Check "Is a contract" and select the contract template related to the product -#. Define default recurrence rules +3. Define default recurrence rules Bug Tracker =========== @@ -55,7 +58,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. @@ -63,23 +66,23 @@ Credits ======= Authors -~~~~~~~ +------- * LasLabs * ACSONE SA/NV Contributors -~~~~~~~~~~~~ +------------ -* Ted Salmon -* Souheil Bejaoui -* `Tecnativa `__: +- Ted Salmon +- Souheil Bejaoui +- `Tecnativa `__: - * Ernesto Tejeda - * Pedro M. Baeza + - Ernesto Tejeda + - Pedro M. Baeza Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -99,6 +102,6 @@ Current `maintainer `__: |maintainer-sbejaoui| -This module is part of the `OCA/contract `_ project on GitHub. +This module is part of the `OCA/contract `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_contract/models/res_company.py b/product_contract/models/res_company.py index 099137c43..508b89400 100644 --- a/product_contract/models/res_company.py +++ b/product_contract/models/res_company.py @@ -5,7 +5,6 @@ from odoo import fields, models class ResCompany(models.Model): - _inherit = "res.company" create_contract_at_sale_order_confirmation = fields.Boolean( diff --git a/product_contract/models/res_config_settings.py b/product_contract/models/res_config_settings.py index cd399a197..f0d694b88 100644 --- a/product_contract/models/res_config_settings.py +++ b/product_contract/models/res_config_settings.py @@ -5,7 +5,6 @@ from odoo import fields, models class ResConfigSettings(models.TransientModel): - _inherit = "res.config.settings" create_contract_at_sale_order_confirmation = fields.Boolean( diff --git a/product_contract/models/sale_order.py b/product_contract/models/sale_order.py index d72e7a82f..b764750e4 100644 --- a/product_contract/models/sale_order.py +++ b/product_contract/models/sale_order.py @@ -49,9 +49,7 @@ class SaleOrder(models.Model): def _prepare_contract_value(self, contract_template): self.ensure_one() return { - "name": "{template_name}: {sale_name}".format( - template_name=contract_template.name, sale_name=self.name - ), + "name": f"{contract_template.name}: {self.name}", "partner_id": self.partner_id.id, "company_id": self.company_id.id, "contract_template_id": contract_template.id, diff --git a/product_contract/pyproject.toml b/product_contract/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/product_contract/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_contract/readme/CONTRIBUTORS.md b/product_contract/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..b8136c4c8 --- /dev/null +++ b/product_contract/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Ted Salmon \<\> +- Souheil Bejaoui \<\> +- [Tecnativa](https://www.tecnativa.com): + - Ernesto Tejeda + - Pedro M. Baeza diff --git a/product_contract/readme/CONTRIBUTORS.rst b/product_contract/readme/CONTRIBUTORS.rst deleted file mode 100644 index 62a6b88fe..000000000 --- a/product_contract/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,6 +0,0 @@ -* Ted Salmon -* Souheil Bejaoui -* `Tecnativa `__: - - * Ernesto Tejeda - * Pedro M. Baeza diff --git a/product_contract/readme/DESCRIPTION.md b/product_contract/readme/DESCRIPTION.md new file mode 100644 index 000000000..fb27386ad --- /dev/null +++ b/product_contract/readme/DESCRIPTION.md @@ -0,0 +1,8 @@ +This module adds support for products to be linked to contract +templates. + +A contract is created on `sale.order` confirmation for each different +template used in sale order line where recurrence details are set too. + +Contract product are ignored on invoicing process and pass to nothing to +invoice directly. diff --git a/product_contract/readme/DESCRIPTION.rst b/product_contract/readme/DESCRIPTION.rst deleted file mode 100644 index e620eb278..000000000 --- a/product_contract/readme/DESCRIPTION.rst +++ /dev/null @@ -1,5 +0,0 @@ -This module adds support for products to be linked to contract templates. - -A contract is created on ``sale.order`` confirmation for each different template used in sale order line where recurrence details are set too. - -Contract product are ignored on invoicing process and pass to nothing to invoice directly. diff --git a/product_contract/readme/USAGE.md b/product_contract/readme/USAGE.md new file mode 100644 index 000000000..7d1d09030 --- /dev/null +++ b/product_contract/readme/USAGE.md @@ -0,0 +1,6 @@ +To use this module, you need to: + +1. Go to Sales -\> Products and select or create a product. +2. Check "Is a contract" and select the contract template related to + the product +3. Define default recurrence rules diff --git a/product_contract/readme/USAGE.rst b/product_contract/readme/USAGE.rst deleted file mode 100644 index 1ed5d4718..000000000 --- a/product_contract/readme/USAGE.rst +++ /dev/null @@ -1,6 +0,0 @@ -To use this module, you need to: - -#. Go to Sales -> Products and select or create a product. -#. Check "Is a contract" and select the contract template related to the - product -#. Define default recurrence rules diff --git a/product_contract/static/description/index.html b/product_contract/static/description/index.html index a5d3d0bd5..197519514 100644 --- a/product_contract/static/description/index.html +++ b/product_contract/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,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. @@ -275,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 } @@ -301,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,10 +369,13 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:ad8724fbb6c54e3f450ed7f3b3aa16384ed79b097065f0de96cc56e87eef2e71 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

This module adds support for products to be linked to contract templates.

-

A contract is created on sale.order confirmation for each different template used in sale order line where recurrence details are set too.

-

Contract product are ignored on invoicing process and pass to nothing to invoice directly.

+

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

+

This module adds support for products to be linked to contract +templates.

+

A contract is created on sale.order confirmation for each different +template used in sale order line where recurrence details are set too.

+

Contract product are ignored on invoicing process and pass to nothing to +invoice directly.

Table of contents

    @@ -401,7 +404,7 @@ product

    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.

@@ -428,13 +431,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:

sbejaoui

-

This module is part of the OCA/contract project on GitHub.

+

This module is part of the OCA/contract project on GitHub.

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

diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..7d41f1be0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# generated from manifests external_dependencies +python-dateutil