From 989080c1d6ab9e3d7082a350bf815a4794f30232 Mon Sep 17 00:00:00 2001 From: Antoni Marroig Campomar Date: Tue, 14 May 2024 11:33:17 +0200 Subject: [PATCH] [IMP] quality_control_oca: pre-commit auto fixes --- quality_control_oca/README.rst | 88 +++++++++---------- quality_control_oca/models/qc_inspection.py | 4 +- quality_control_oca/pyproject.toml | 3 + quality_control_oca/readme/CONFIGURE.md | 22 +++++ quality_control_oca/readme/CONFIGURE.rst | 26 ------ quality_control_oca/readme/CONTRIBUTORS.md | 12 +++ quality_control_oca/readme/CONTRIBUTORS.rst | 15 ---- quality_control_oca/readme/CREDITS.md | 2 + quality_control_oca/readme/CREDITS.rst | 1 - quality_control_oca/readme/DESCRIPTION.md | 3 + quality_control_oca/readme/DESCRIPTION.rst | 3 - quality_control_oca/readme/ROADMAP.md | 1 + quality_control_oca/readme/ROADMAP.rst | 1 - .../static/description/index.html | 37 ++++---- .../tests/test_quality_control.py | 2 +- 15 files changed, 105 insertions(+), 115 deletions(-) create mode 100644 quality_control_oca/pyproject.toml create mode 100644 quality_control_oca/readme/CONFIGURE.md delete mode 100644 quality_control_oca/readme/CONFIGURE.rst create mode 100644 quality_control_oca/readme/CONTRIBUTORS.md delete mode 100644 quality_control_oca/readme/CONTRIBUTORS.rst create mode 100644 quality_control_oca/readme/CREDITS.md delete mode 100644 quality_control_oca/readme/CREDITS.rst create mode 100644 quality_control_oca/readme/DESCRIPTION.md delete mode 100644 quality_control_oca/readme/DESCRIPTION.rst create mode 100644 quality_control_oca/readme/ROADMAP.md delete mode 100644 quality_control_oca/readme/ROADMAP.rst diff --git a/quality_control_oca/README.rst b/quality_control_oca/README.rst index 6ad880d51..1b1110a45 100644 --- a/quality_control_oca/README.rst +++ b/quality_control_oca/README.rst @@ -17,20 +17,20 @@ Quality Control OCA :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github - :target: https://github.com/OCA/manufacture/tree/16.0/quality_control_oca + :target: https://github.com/OCA/manufacture/tree/17.0/quality_control_oca :alt: OCA/manufacture .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-quality_control_oca + :target: https://translation.odoo-community.org/projects/manufacture-17-0/manufacture-17-0-quality_control_oca :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/manufacture&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module provides a generic infrastructure for quality tests. The idea is -that it can be later reused for doing quality inspections on production lots -or any other area of the company. +This module provides a generic infrastructure for quality tests. The +idea is that it can be later reused for doing quality inspections on +production lots or any other area of the company. **Table of contents** @@ -40,37 +40,33 @@ or any other area of the company. Configuration ============= -* Question: The thing to be checked. We have two types of questions: - -* Qualitative: The result is a description, color, yes, no... - -* Quantitative: The result must be within a range. - -* Possible values: The values chosen in qualitative questions. - -* Test: The set of questions to be used in inspections. - -* Once these values are set, we define the inspection. +- Question: The thing to be checked. We have two types of questions: +- Qualitative: The result is a description, color, yes, no... +- Quantitative: The result must be within a range. +- Possible values: The values chosen in qualitative questions. +- Test: The set of questions to be used in inspections. +- Once these values are set, we define the inspection. We have a *generic* test that can be applied to any model: shipments, -invoices or product, or a *test related*, making it specific to a particular -product and that eg apply whenever food is sold or when creating a batch. +invoices or product, or a *test related*, making it specific to a +particular product and that eg apply whenever food is sold or when +creating a batch. Once these parameters are set, we can just pass the test. We create a -new inspection, selecting a relationship with the model (sale, stock move...), -and pressing "Select test" button to choose the test to pass. Then, you must -fill the lines depending on the chosen test. +new inspection, selecting a relationship with the model (sale, stock +move...), and pressing "Select test" button to choose the test to pass. +Then, you must fill the lines depending on the chosen test. The complete inspection workflow is: - Draft -> Confirmed -> Success - | - | -> Failure (Pending approval) -> Approved + Draft -> Confirmed -> Success + + -> Failure (Pending approval) -> Approved Known issues / Roadmap ====================== -* Make translatable the trigger name. +- Make translatable the trigger name. Bug Tracker =========== @@ -78,7 +74,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. @@ -86,37 +82,39 @@ Credits ======= Authors -~~~~~~~ +------- * AvanzOSC * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* Oihane Crucelaegui -* Ana Juaristi -* Lois Rilo -* Simone Rubino -* Juan Humanes -* Ignacio José Alés López -* Pimolnat Suntian -* `Tecnativa `_: +- Oihane Crucelaegui +- Ana Juaristi +- Lois Rilo +- Simone Rubino +- Juan Humanes +- Ignacio José Alés López +- Pimolnat Suntian +- `Tecnativa `__: - * Pedro M. Baeza - * Carlos Roca + - Pedro M. Baeza + - Carlos Roca -* `Trey Kilobytes de Soluciones SL `__: +- `Trey Kilobytes de Soluciones SL `__: - * Vicent Cubells + - Vicent Cubells Other credits -~~~~~~~~~~~~~ +------------- -* Originally based on the old nan_quality_control_* modules from NaN·tic. +- Originally based on the old + `nan_quality_control `__ + modules from NaN·tic. Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -128,6 +126,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/manufacture `_ project on GitHub. +This module is part of the `OCA/manufacture `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/quality_control_oca/models/qc_inspection.py b/quality_control_oca/models/qc_inspection.py index 885d841b0..d75fc3969 100644 --- a/quality_control_oca/models/qc_inspection.py +++ b/quality_control_oca/models/qc_inspection.py @@ -203,9 +203,7 @@ class QcInspection(models.Model): :return: List of values for creating the inspection """ return { - "object_id": object_ref - and "{},{}".format(object_ref._name, object_ref.id) - or False, + "object_id": object_ref and f"{object_ref._name},{object_ref.id}" or False, "state": "ready", "test": trigger_line.test.id, "user": trigger_line.user.id, diff --git a/quality_control_oca/pyproject.toml b/quality_control_oca/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/quality_control_oca/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/quality_control_oca/readme/CONFIGURE.md b/quality_control_oca/readme/CONFIGURE.md new file mode 100644 index 000000000..4a744b780 --- /dev/null +++ b/quality_control_oca/readme/CONFIGURE.md @@ -0,0 +1,22 @@ +- Question: The thing to be checked. We have two types of questions: +- Qualitative: The result is a description, color, yes, no... +- Quantitative: The result must be within a range. +- Possible values: The values chosen in qualitative questions. +- Test: The set of questions to be used in inspections. +- Once these values are set, we define the inspection. + +We have a *generic* test that can be applied to any model: shipments, +invoices or product, or a *test related*, making it specific to a +particular product and that eg apply whenever food is sold or when +creating a batch. + +Once these parameters are set, we can just pass the test. We create a +new inspection, selecting a relationship with the model (sale, stock +move...), and pressing "Select test" button to choose the test to pass. +Then, you must fill the lines depending on the chosen test. + +The complete inspection workflow is: + +> Draft -\> Confirmed -\> Success +> +> -\> Failure (Pending approval) -\> Approved diff --git a/quality_control_oca/readme/CONFIGURE.rst b/quality_control_oca/readme/CONFIGURE.rst deleted file mode 100644 index aab4b03db..000000000 --- a/quality_control_oca/readme/CONFIGURE.rst +++ /dev/null @@ -1,26 +0,0 @@ -* Question: The thing to be checked. We have two types of questions: - -* Qualitative: The result is a description, color, yes, no... - -* Quantitative: The result must be within a range. - -* Possible values: The values chosen in qualitative questions. - -* Test: The set of questions to be used in inspections. - -* Once these values are set, we define the inspection. - -We have a *generic* test that can be applied to any model: shipments, -invoices or product, or a *test related*, making it specific to a particular -product and that eg apply whenever food is sold or when creating a batch. - -Once these parameters are set, we can just pass the test. We create a -new inspection, selecting a relationship with the model (sale, stock move...), -and pressing "Select test" button to choose the test to pass. Then, you must -fill the lines depending on the chosen test. - -The complete inspection workflow is: - - Draft -> Confirmed -> Success - | - | -> Failure (Pending approval) -> Approved diff --git a/quality_control_oca/readme/CONTRIBUTORS.md b/quality_control_oca/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..1e64eb423 --- /dev/null +++ b/quality_control_oca/readme/CONTRIBUTORS.md @@ -0,0 +1,12 @@ +- Oihane Crucelaegui \<\> +- Ana Juaristi \<\> +- Lois Rilo \<\> +- Simone Rubino \<\> +- Juan Humanes \<\> +- Ignacio José Alés López \<\> +- Pimolnat Suntian \<\> +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - Carlos Roca +- [Trey Kilobytes de Soluciones SL](https://www.trey.es): + - Vicent Cubells diff --git a/quality_control_oca/readme/CONTRIBUTORS.rst b/quality_control_oca/readme/CONTRIBUTORS.rst deleted file mode 100644 index 43f7ec2a4..000000000 --- a/quality_control_oca/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,15 +0,0 @@ -* Oihane Crucelaegui -* Ana Juaristi -* Lois Rilo -* Simone Rubino -* Juan Humanes -* Ignacio José Alés López -* Pimolnat Suntian -* `Tecnativa `_: - - * Pedro M. Baeza - * Carlos Roca - -* `Trey Kilobytes de Soluciones SL `__: - - * Vicent Cubells diff --git a/quality_control_oca/readme/CREDITS.md b/quality_control_oca/readme/CREDITS.md new file mode 100644 index 000000000..5e37f5693 --- /dev/null +++ b/quality_control_oca/readme/CREDITS.md @@ -0,0 +1,2 @@ +- Originally based on the old [nan_quality_control](https://github.com/NaN-tic/nan_quality_control) modules from + NaN·tic. diff --git a/quality_control_oca/readme/CREDITS.rst b/quality_control_oca/readme/CREDITS.rst deleted file mode 100644 index 67e7399d6..000000000 --- a/quality_control_oca/readme/CREDITS.rst +++ /dev/null @@ -1 +0,0 @@ -* Originally based on the old nan_quality_control_* modules from NaN·tic. diff --git a/quality_control_oca/readme/DESCRIPTION.md b/quality_control_oca/readme/DESCRIPTION.md new file mode 100644 index 000000000..b13a59ead --- /dev/null +++ b/quality_control_oca/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module provides a generic infrastructure for quality tests. The +idea is that it can be later reused for doing quality inspections on +production lots or any other area of the company. diff --git a/quality_control_oca/readme/DESCRIPTION.rst b/quality_control_oca/readme/DESCRIPTION.rst deleted file mode 100644 index 0f33feb2a..000000000 --- a/quality_control_oca/readme/DESCRIPTION.rst +++ /dev/null @@ -1,3 +0,0 @@ -This module provides a generic infrastructure for quality tests. The idea is -that it can be later reused for doing quality inspections on production lots -or any other area of the company. diff --git a/quality_control_oca/readme/ROADMAP.md b/quality_control_oca/readme/ROADMAP.md new file mode 100644 index 000000000..4a3f4872a --- /dev/null +++ b/quality_control_oca/readme/ROADMAP.md @@ -0,0 +1 @@ +- Make translatable the trigger name. diff --git a/quality_control_oca/readme/ROADMAP.rst b/quality_control_oca/readme/ROADMAP.rst deleted file mode 100644 index b0ab3659f..000000000 --- a/quality_control_oca/readme/ROADMAP.rst +++ /dev/null @@ -1 +0,0 @@ -* Make translatable the trigger name. diff --git a/quality_control_oca/static/description/index.html b/quality_control_oca/static/description/index.html index 18ede94f0..5d6194b18 100644 --- a/quality_control_oca/static/description/index.html +++ b/quality_control_oca/static/description/index.html @@ -368,10 +368,10 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:f681e05b0e199eb1c9dc6fbaaf96e42573ad9f3de8c94fdb10219d577b0dc541 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

This module provides a generic infrastructure for quality tests. The idea is -that it can be later reused for doing quality inspections on production lots -or any other area of the company.

+

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

+

This module provides a generic infrastructure for quality tests. The +idea is that it can be later reused for doing quality inspections on +production lots or any other area of the company.

Table of contents

    @@ -398,22 +398,17 @@ or any other area of the company.

  • Once these values are set, we define the inspection.

We have a generic test that can be applied to any model: shipments, -invoices or product, or a test related, making it specific to a particular -product and that eg apply whenever food is sold or when creating a batch.

+invoices or product, or a test related, making it specific to a +particular product and that eg apply whenever food is sold or when +creating a batch.

Once these parameters are set, we can just pass the test. We create a -new inspection, selecting a relationship with the model (sale, stock move…), -and pressing “Select test” button to choose the test to pass. Then, you must -fill the lines depending on the chosen test.

+new inspection, selecting a relationship with the model (sale, stock +move…), and pressing “Select test” button to choose the test to pass. +Then, you must fill the lines depending on the chosen test.

The complete inspection workflow is:

-
-
Draft -> Confirmed -> Success
-
-

-
-> Failure (Pending approval) -> Approved
-
-
-
+

Draft -> Confirmed -> Success

+

-> Failure (Pending approval) -> Approved

@@ -427,7 +422,7 @@ fill the lines depending on the chosen test.

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.

@@ -463,7 +458,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Other credits

    -
  • Originally based on the old nan_quality_control_* modules from NaN·tic.
  • +
  • Originally based on the old +nan_quality_control +modules from NaN·tic.
@@ -473,7 +470,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

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

+

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

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

diff --git a/quality_control_oca/tests/test_quality_control.py b/quality_control_oca/tests/test_quality_control.py index 9dd08200b..fe1c8f9be 100644 --- a/quality_control_oca/tests/test_quality_control.py +++ b/quality_control_oca/tests/test_quality_control.py @@ -129,7 +129,7 @@ class TestQualityControlOca(TestQualityControlOcaBase): ) self.assertEqual( category2.complete_name, - "{} / {}".format(category1.name, category2.name), + f"{category1.name} / {category2.name}", "Something went wrong when computing complete name", ) with self.assertRaises(exceptions.UserError):