diff --git a/stock_move_line_reference_link/README.rst b/stock_move_line_reference_link/README.rst index fd809b545556..241db9b60336 100644 --- a/stock_move_line_reference_link/README.rst +++ b/stock_move_line_reference_link/README.rst @@ -17,13 +17,13 @@ Stock Move Line Reference Link :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--workflow-lightgray.png?logo=github - :target: https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_move_line_reference_link + :target: https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_move_line_reference_link :alt: OCA/stock-logistics-workflow .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_move_line_reference_link + :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_move_line_reference_link :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-workflow&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -41,7 +41,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. @@ -56,7 +56,8 @@ Authors Contributors ------------ -- Miquel Raïch +- Miquel Raïch +- ``Heliconia Solutions Pvt. Ltd. ``\ \_ Maintainers ----------- @@ -71,6 +72,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-workflow `_ project on GitHub. +This module is part of the `OCA/stock-logistics-workflow `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_move_line_reference_link/__manifest__.py b/stock_move_line_reference_link/__manifest__.py index 9e7ee8b4eaa1..a0b111c341e6 100644 --- a/stock_move_line_reference_link/__manifest__.py +++ b/stock_move_line_reference_link/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Move Line Reference Link", "summary": "Add link in stock move line references.", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-workflow", "author": "ForgeFlow, Odoo Community Association (OCA)", diff --git a/stock_move_line_reference_link/readme/CONTRIBUTORS.md b/stock_move_line_reference_link/readme/CONTRIBUTORS.md index 1da3d73e294a..0e30f0c1cff0 100644 --- a/stock_move_line_reference_link/readme/CONTRIBUTORS.md +++ b/stock_move_line_reference_link/readme/CONTRIBUTORS.md @@ -1 +1,2 @@ - Miquel Raïch \<\> +- `Heliconia Solutions Pvt. Ltd. `_ diff --git a/stock_move_line_reference_link/static/description/index.html b/stock_move_line_reference_link/static/description/index.html index 084032e745d6..7f54a6d1a06c 100644 --- a/stock_move_line_reference_link/static/description/index.html +++ b/stock_move_line_reference_link/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,7 +369,7 @@

Stock Move Line Reference Link

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:e62c86340f5fed7cc18d6605fbf6719b109889d00b28c2fdd73bed413181cc7c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module adds link to references in stock move lines.

Table of contents

@@ -387,7 +388,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.

@@ -402,16 +403,19 @@

Authors

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/stock-logistics-workflow project on GitHub.

+

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

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

diff --git a/stock_move_line_reference_link/tests/__init__.py b/stock_move_line_reference_link/tests/__init__.py new file mode 100644 index 000000000000..e74da26e3375 --- /dev/null +++ b/stock_move_line_reference_link/tests/__init__.py @@ -0,0 +1 @@ +from . import test_move_line diff --git a/stock_move_line_reference_link/tests/test_move_line.py b/stock_move_line_reference_link/tests/test_move_line.py new file mode 100644 index 000000000000..7e4436f15033 --- /dev/null +++ b/stock_move_line_reference_link/tests/test_move_line.py @@ -0,0 +1,74 @@ +from odoo.tests.common import TransactionCase + + +class TestStockMoveLine(TransactionCase): + def setUp(self): + super().setUp() + # Set up required records for the test + self.product = self.env["product.product"].create( + { + "name": "Test Product", + "sale_line_warn": "no-message", + } + ) + self.stock_location = self.env["stock.location"].create( + { + "name": "Test Location", + } + ) + self.picking_type = self.env["stock.picking.type"].create( + {"name": "Test Picking Type", "code": "outgoing", "sequence_code": "SPT"} + ) + self.picking = self.env["stock.picking"].create( + { + "picking_type_id": self.picking_type.id, + "location_id": self.stock_location.id, + "location_dest_id": self.stock_location.id, + } + ) + self.move = self.env["stock.move"].create( + { + "name": "Test Move", + "product_id": self.product.id, + "product_uom_qty": 10, + "location_id": self.stock_location.id, + "location_dest_id": self.stock_location.id, + "picking_id": self.picking.id, + } + ) + self.move_line = self.env["stock.move.line"].create( + { + "product_id": self.product.id, + "move_id": self.move.id, + "location_id": self.stock_location.id, + "location_dest_id": self.stock_location.id, + } + ) + + def test_linked_reference_with_picking(self): + # Ensure the linked_reference computes correctly + # when move is linked to a picking + self.assertEqual( + self.move_line.linked_reference, + f"stock.picking,{self.picking.id}", + "linked_reference should point to the picking when available", + ) + + def test_linked_reference_with_move(self): + # Detach the picking and test the reference computation for the move + self.move.picking_id = False + self.move_line._compute_linked_reference() + self.assertEqual( + self.move_line.linked_reference, + f"stock.move,{self.move.id}", + "linked_reference should point to the move when picking is not available", + ) + + def test_linked_reference_no_reference(self): + # Detach move reference entirely and test + self.move_line.move_id = False + self.move_line._compute_linked_reference() # Trigger compute manually + self.assertFalse( + self.move_line.linked_reference, + "linked_reference should be False if no picking or move is available", + )