From 71d6610abb06d4e222652eb38a843ca72310ccd0 Mon Sep 17 00:00:00 2001 From: chien Date: Mon, 10 Jun 2024 14:51:36 +0700 Subject: [PATCH] [IMP] stock_packaging_calculator: pre-commit auto fixes --- stock_packaging_calculator/README.rst | 70 ++++++++++--------- stock_packaging_calculator/pyproject.toml | 3 + .../readme/CONTRIBUTORS.md | 2 + .../readme/CONTRIBUTORS.rst | 2 - .../{DESCRIPTION.rst => DESCRIPTION.md} | 3 +- stock_packaging_calculator/readme/ROADMAP.md | 4 ++ stock_packaging_calculator/readme/ROADMAP.rst | 4 -- stock_packaging_calculator/readme/USAGE.md | 37 ++++++++++ stock_packaging_calculator/readme/USAGE.rst | 36 ---------- .../static/description/index.html | 22 +++--- stock_packaging_calculator/tests/common.py | 1 - 11 files changed, 96 insertions(+), 88 deletions(-) create mode 100644 stock_packaging_calculator/pyproject.toml create mode 100644 stock_packaging_calculator/readme/CONTRIBUTORS.md delete mode 100644 stock_packaging_calculator/readme/CONTRIBUTORS.rst rename stock_packaging_calculator/readme/{DESCRIPTION.rst => DESCRIPTION.md} (70%) create mode 100644 stock_packaging_calculator/readme/ROADMAP.md delete mode 100644 stock_packaging_calculator/readme/ROADMAP.rst create mode 100644 stock_packaging_calculator/readme/USAGE.md delete mode 100644 stock_packaging_calculator/readme/USAGE.rst diff --git a/stock_packaging_calculator/README.rst b/stock_packaging_calculator/README.rst index 0668c20a3..c635d89ec 100644 --- a/stock_packaging_calculator/README.rst +++ b/stock_packaging_calculator/README.rst @@ -17,18 +17,19 @@ Stock packaging calculator :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github - :target: https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_packaging_calculator + :target: https://github.com/OCA/stock-logistics-warehouse/tree/17.0/stock_packaging_calculator :alt: OCA/stock-logistics-warehouse .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_packaging_calculator + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-17-0/stock-logistics-warehouse-17-0-stock_packaging_calculator :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/stock-logistics-warehouse&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -Basic module providing an helper method to calculate the quantity of product by packaging. +Basic module providing an helper method to calculate the quantity of +product by packaging. **Table of contents** @@ -40,40 +41,41 @@ Usage Imagine you have the following packagings: -* Pallet: 1000 Units -* Big box: 500 Units -* Box: 50 Units +- Pallet: 1000 Units +- Big box: 500 Units +- Box: 50 Units and you have to pick from your warehouse 2860 Units. Then you can do: - .. code-block:: + :: - >>> product.product_qty_by_packaging(2860) + >>> product.product_qty_by_packaging(2860) - [ - {"id": 1, "qty": 2, "name": "Pallet"}, - {"id": 2, "qty": 1, "name": "Big box"}, - {"id": 3, "qty": 7, "name": "Box"}, - {"id": 100, "qty": 10, "name": "Units"}, - ] + [ + {"id": 1, "qty": 2, "name": "Pallet"}, + {"id": 2, "qty": 1, "name": "Big box"}, + {"id": 3, "qty": 7, "name": "Box"}, + {"id": 100, "qty": 10, "name": "Units"}, + ] -With this you can show a proper message to warehouse operators to quickly pick the quantity they need. +With this you can show a proper message to warehouse operators to +quickly pick the quantity they need. -Optionally you can get contained packaging by passing `with_contained` flag: +Optionally you can get contained packaging by passing with_contained +flag: + :: - .. code-block:: + >>> product.product_qty_by_packaging(2860, with_contained=True) - >>> product.product_qty_by_packaging(2860, with_contained=True) - - [ - {"id": 1, "qty": 2, "name": "Pallet", "contained": [{"id": 2, "qty": 2, "name": "Big box"}]}, - {"id": 2, "qty": 1, "name": "Big box", "contained": [{"id": 3, "qty": 10, "name": "Box"}]}, - {"id": 3, "qty": 7, "name": "Box", "contained": [{"id": 100, "qty": 50, "name": "Units"}]}, - {"id": 100, "qty": 10, "name": "Units", "contained": []},}, - ] + [ + {"id": 1, "qty": 2, "name": "Pallet", "contained": [{"id": 2, "qty": 2, "name": "Big box"}]}, + {"id": 2, "qty": 1, "name": "Big box", "contained": [{"id": 3, "qty": 10, "name": "Box"}]}, + {"id": 3, "qty": 7, "name": "Box", "contained": [{"id": 100, "qty": 50, "name": "Units"}]}, + {"id": 100, "qty": 10, "name": "Units", "contained": []},}, + ] Known issues / Roadmap ====================== @@ -81,7 +83,7 @@ Known issues / Roadmap TODO 1. Fractional quantities (eg: 0.5 Kg) are lost when counting units -2. Maybe rely on `packaging_uom` +2. Maybe rely on packaging_uom Bug Tracker =========== @@ -89,7 +91,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. @@ -97,18 +99,18 @@ Credits ======= Authors -~~~~~~~ +------- * Camptocamp Contributors -~~~~~~~~~~~~ +------------ -* Simone Orsi -* Christopher Ormaza +- Simone Orsi +- Christopher Ormaza Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -120,6 +122,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/stock-logistics-warehouse `_ project on GitHub. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_packaging_calculator/pyproject.toml b/stock_packaging_calculator/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/stock_packaging_calculator/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_packaging_calculator/readme/CONTRIBUTORS.md b/stock_packaging_calculator/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..ed45df4f2 --- /dev/null +++ b/stock_packaging_calculator/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Simone Orsi \<\> +- Christopher Ormaza \<\> diff --git a/stock_packaging_calculator/readme/CONTRIBUTORS.rst b/stock_packaging_calculator/readme/CONTRIBUTORS.rst deleted file mode 100644 index 5daf85c2e..000000000 --- a/stock_packaging_calculator/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Simone Orsi -* Christopher Ormaza diff --git a/stock_packaging_calculator/readme/DESCRIPTION.rst b/stock_packaging_calculator/readme/DESCRIPTION.md similarity index 70% rename from stock_packaging_calculator/readme/DESCRIPTION.rst rename to stock_packaging_calculator/readme/DESCRIPTION.md index 1d6fceb5c..ac5ca22dd 100644 --- a/stock_packaging_calculator/readme/DESCRIPTION.rst +++ b/stock_packaging_calculator/readme/DESCRIPTION.md @@ -1 +1,2 @@ -Basic module providing an helper method to calculate the quantity of product by packaging. +Basic module providing an helper method to calculate the quantity of +product by packaging. diff --git a/stock_packaging_calculator/readme/ROADMAP.md b/stock_packaging_calculator/readme/ROADMAP.md new file mode 100644 index 000000000..c031f1086 --- /dev/null +++ b/stock_packaging_calculator/readme/ROADMAP.md @@ -0,0 +1,4 @@ +TODO + +1. Fractional quantities (eg: 0.5 Kg) are lost when counting units +2. Maybe rely on packaging_uom diff --git a/stock_packaging_calculator/readme/ROADMAP.rst b/stock_packaging_calculator/readme/ROADMAP.rst deleted file mode 100644 index e4881d5e6..000000000 --- a/stock_packaging_calculator/readme/ROADMAP.rst +++ /dev/null @@ -1,4 +0,0 @@ -TODO - -1. Fractional quantities (eg: 0.5 Kg) are lost when counting units -2. Maybe rely on `packaging_uom` diff --git a/stock_packaging_calculator/readme/USAGE.md b/stock_packaging_calculator/readme/USAGE.md new file mode 100644 index 000000000..b09b9e24b --- /dev/null +++ b/stock_packaging_calculator/readme/USAGE.md @@ -0,0 +1,37 @@ +Imagine you have the following packagings: + +- Pallet: 1000 Units +- Big box: 500 Units +- Box: 50 Units + +and you have to pick from your warehouse 2860 Units. + +Then you can do: + +> ``` +> >>> product.product_qty_by_packaging(2860) +> +> [ +> {"id": 1, "qty": 2, "name": "Pallet"}, +> {"id": 2, "qty": 1, "name": "Big box"}, +> {"id": 3, "qty": 7, "name": "Box"}, +> {"id": 100, "qty": 10, "name": "Units"}, +> ] +> ``` + +With this you can show a proper message to warehouse operators to +quickly pick the quantity they need. + +Optionally you can get contained packaging by passing with_contained +flag: + +> ``` +> >>> product.product_qty_by_packaging(2860, with_contained=True) +> +> [ +> {"id": 1, "qty": 2, "name": "Pallet", "contained": [{"id": 2, "qty": 2, "name": "Big box"}]}, +> {"id": 2, "qty": 1, "name": "Big box", "contained": [{"id": 3, "qty": 10, "name": "Box"}]}, +> {"id": 3, "qty": 7, "name": "Box", "contained": [{"id": 100, "qty": 50, "name": "Units"}]}, +> {"id": 100, "qty": 10, "name": "Units", "contained": []},}, +> ] +> ``` diff --git a/stock_packaging_calculator/readme/USAGE.rst b/stock_packaging_calculator/readme/USAGE.rst deleted file mode 100644 index 73f05a708..000000000 --- a/stock_packaging_calculator/readme/USAGE.rst +++ /dev/null @@ -1,36 +0,0 @@ -Imagine you have the following packagings: - -* Pallet: 1000 Units -* Big box: 500 Units -* Box: 50 Units - -and you have to pick from your warehouse 2860 Units. - -Then you can do: - - .. code-block:: - - >>> product.product_qty_by_packaging(2860) - - [ - {"id": 1, "qty": 2, "name": "Pallet"}, - {"id": 2, "qty": 1, "name": "Big box"}, - {"id": 3, "qty": 7, "name": "Box"}, - {"id": 100, "qty": 10, "name": "Units"}, - ] - -With this you can show a proper message to warehouse operators to quickly pick the quantity they need. - -Optionally you can get contained packaging by passing `with_contained` flag: - - - .. code-block:: - - >>> product.product_qty_by_packaging(2860, with_contained=True) - - [ - {"id": 1, "qty": 2, "name": "Pallet", "contained": [{"id": 2, "qty": 2, "name": "Big box"}]}, - {"id": 2, "qty": 1, "name": "Big box", "contained": [{"id": 3, "qty": 10, "name": "Box"}]}, - {"id": 3, "qty": 7, "name": "Box", "contained": [{"id": 100, "qty": 50, "name": "Units"}]}, - {"id": 100, "qty": 10, "name": "Units", "contained": []},}, - ] diff --git a/stock_packaging_calculator/static/description/index.html b/stock_packaging_calculator/static/description/index.html index 39478209a..8582a89c6 100644 --- a/stock_packaging_calculator/static/description/index.html +++ b/stock_packaging_calculator/static/description/index.html @@ -1,4 +1,3 @@ - @@ -369,8 +368,9 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:7f199b0f860e5108a32b20d253fdf4e90e51bd2ba3088e0b48c5465c1274b5a8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runboat

-

Basic module providing an helper method to calculate the quantity of product by packaging.

+

Beta License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runboat

+

Basic module providing an helper method to calculate the quantity of +product by packaging.

Table of contents

    @@ -396,7 +396,7 @@ ul.auto-toc {

    and you have to pick from your warehouse 2860 Units.

    Then you can do:

    -
    +
     >>> product.product_qty_by_packaging(2860)
     
     [
    @@ -407,10 +407,12 @@ ul.auto-toc {
     ]
     
    -

    With this you can show a proper message to warehouse operators to quickly pick the quantity they need.

    -

    Optionally you can get contained packaging by passing with_contained flag:

    +

    With this you can show a proper message to warehouse operators to +quickly pick the quantity they need.

    +

    Optionally you can get contained packaging by passing with_contained +flag:

    -
    +
     >>> product.product_qty_by_packaging(2860, with_contained=True)
     
     [
    @@ -427,7 +429,7 @@ ul.auto-toc {
     

    TODO

    1. Fractional quantities (eg: 0.5 Kg) are lost when counting units
    2. -
    3. Maybe rely on packaging_uom
    4. +
    5. Maybe rely on packaging_uom
@@ -435,7 +437,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.

@@ -460,7 +462,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/stock-logistics-warehouse project on GitHub.

+

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

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

diff --git a/stock_packaging_calculator/tests/common.py b/stock_packaging_calculator/tests/common.py index 4aa0579a5..082084567 100644 --- a/stock_packaging_calculator/tests/common.py +++ b/stock_packaging_calculator/tests/common.py @@ -4,7 +4,6 @@ from odoo.tests import TransactionCase class TestCommon(TransactionCase): - at_install = False post_install = True maxDiff = None