diff --git a/stock_location_children/README.rst b/stock_location_children/README.rst new file mode 100644 index 000000000..70f2b6b79 --- /dev/null +++ b/stock_location_children/README.rst @@ -0,0 +1,80 @@ +======================= +Stock location children +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-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/13.0/stock_location_children + :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-13-0/stock-logistics-warehouse-13-0-stock_location_children + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/153/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a `children_ids` field on `stock.location` in order to compute +and store all the children for a `stock.location` and not only its first level +children as is the case for `child_ids`. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Akim Juillerat + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_location_children/i18n/stock_location_children.pot b/stock_location_children/i18n/stock_location_children.pot new file mode 100644 index 000000000..edb90caff --- /dev/null +++ b/stock_location_children/i18n/stock_location_children.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_location_children +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_location_children +#: model:ir.model.fields,help:stock_location_children.field_stock_location__children_ids +msgid "All the children (multi-level) stock location of this location" +msgstr "" + +#. module: stock_location_children +#: model:ir.model.fields,field_description:stock_location_children.field_stock_location__children_ids +msgid "Children" +msgstr "" + +#. module: stock_location_children +#: model:ir.model,name:stock_location_children.model_stock_location +msgid "Inventory Locations" +msgstr "" diff --git a/stock_location_children/static/description/index.html b/stock_location_children/static/description/index.html new file mode 100644 index 000000000..a1059dab0 --- /dev/null +++ b/stock_location_children/static/description/index.html @@ -0,0 +1,427 @@ + + + + + + +Stock location children + + + +
+

Stock location children

+ + +

Alpha License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

This module adds a children_ids field on stock.location in order to compute +and store all the children for a stock.location and not only its first level +children as is the case for child_ids.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+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/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_location_children/tests/test_stock_location_children.py b/stock_location_children/tests/test_stock_location_children.py index f28bbe0cf..773f64b8b 100644 --- a/stock_location_children/tests/test_stock_location_children.py +++ b/stock_location_children/tests/test_stock_location_children.py @@ -11,9 +11,18 @@ class TestStockLocationChildren(SavepointCase): ref = cls.env.ref cls.stock_input = ref("stock.stock_location_company") cls.stock_location = ref("stock.stock_location_stock") - cls.stock_shelf_1 = ref("stock.stock_location_components") - cls.stock_shelf_2 = ref("stock.stock_location_14") - cls.stock_shelf_2_refrigerator = ref("stock.location_refrigerator_small") + cls.test_location = cls.env["stock.location"].create( + {"name": "Test Location", "location_id": cls.stock_location.id} + ) + cls.stock_shelf_1 = cls.env["stock.location"].create( + {"name": "Test Shelf 1", "location_id": cls.test_location.id} + ) + cls.stock_shelf_2 = cls.env["stock.location"].create( + {"name": "Test Shelf 2", "location_id": cls.test_location.id} + ) + cls.stock_shelf_2_refrigerator = cls.env["stock.location"].create( + {"name": "Test Shelf Refrigerator", "location_id": cls.stock_shelf_2.id} + ) def test_location_children(self): self.assertFalse(self.stock_shelf_2_refrigerator.child_ids) @@ -22,10 +31,10 @@ class TestStockLocationChildren(SavepointCase): self.assertFalse(self.stock_shelf_1.child_ids) self.assertFalse(self.stock_shelf_1.children_ids) self.assertEqual( - self.stock_location.child_ids, self.stock_shelf_1 | self.stock_shelf_2 + self.test_location.child_ids, self.stock_shelf_1 | self.stock_shelf_2 ) self.assertEqual( - self.stock_location.children_ids, + self.test_location.children_ids, self.stock_shelf_1 | self.stock_shelf_2 | self.stock_shelf_2_refrigerator, ) @@ -45,7 +54,7 @@ class TestStockLocationChildren(SavepointCase): self.stock_shelf_2_refrigerator | refrigerator_drawer, ) self.assertEqual( - self.stock_location.children_ids, + self.test_location.children_ids, self.stock_shelf_1 | self.stock_shelf_2 | self.stock_shelf_2_refrigerator @@ -56,6 +65,6 @@ class TestStockLocationChildren(SavepointCase): self.assertEqual(self.stock_shelf_2.child_ids, self.stock_shelf_2_refrigerator) self.assertEqual(self.stock_shelf_2.child_ids, self.stock_shelf_2.children_ids) self.assertEqual( - self.stock_location.children_ids, + self.test_location.children_ids, self.stock_shelf_1 | self.stock_shelf_2 | self.stock_shelf_2_refrigerator, )