Skip to content

Commit 8f14396

Browse files
[MIG] stock_move_line_reference_link: Migration to 18.0
1 parent e3432ff commit 8f14396

File tree

6 files changed

+99
-14
lines changed

6 files changed

+99
-14
lines changed

stock_move_line_reference_link/README.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Stock Move Line Reference Link
1717
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1818
:alt: License: LGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github
20-
:target: https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_move_line_reference_link
20+
:target: https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_move_line_reference_link
2121
:alt: OCA/stock-logistics-workflow
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_move_line_reference_link
23+
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_move_line_reference_link
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -41,7 +41,7 @@ Bug Tracker
4141
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/issues>`_.
4242
In case of trouble, please check there if your issue has already been reported.
4343
If you spotted it first, help us to smash it by providing a detailed and welcomed
44-
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_move_line_reference_link%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
44+
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_move_line_reference_link%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
4545

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

@@ -56,7 +56,10 @@ Authors
5656
Contributors
5757
------------
5858

59-
- Miquel Raïch <[email protected]>
59+
- Miquel Raïch <[email protected]>
60+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
61+
62+
- Bhavesh Heliconia
6063

6164
Maintainers
6265
-----------
@@ -71,6 +74,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
7174
mission is to support the collaborative development of Odoo features and
7275
promote its widespread use.
7376

74-
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_move_line_reference_link>`_ project on GitHub.
77+
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_move_line_reference_link>`_ project on GitHub.
7578

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

stock_move_line_reference_link/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Stock Move Line Reference Link",
66
"summary": "Add link in stock move line references.",
7-
"version": "17.0.1.0.0",
7+
"version": "18.0.1.0.0",
88
"license": "LGPL-3",
99
"website": "https://github.com/OCA/stock-logistics-workflow",
1010
"author": "ForgeFlow, Odoo Community Association (OCA)",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
- Miquel Raïch \<<[email protected]>\>
2+
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
3+
- Bhavesh Heliconia

stock_move_line_reference_link/static/description/index.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
/*
1010
:Author: David Goodger ([email protected])
11-
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
11+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
1212
:Copyright: This stylesheet has been placed in the public domain.
1313
1414
Default cascading style sheet for the HTML output of Docutils.
15+
Despite the name, some widely supported CSS2 features are used.
1516
1617
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
1718
customize this style sheet.
@@ -274,7 +275,7 @@
274275
margin-left: 2em ;
275276
margin-right: 2em }
276277

277-
pre.code .ln { color: grey; } /* line numbers */
278+
pre.code .ln { color: gray; } /* line numbers */
278279
pre.code, code { background-color: #eeeeee }
279280
pre.code .comment, code .comment { color: #5C6576 }
280281
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -300,7 +301,7 @@
300301
span.pre {
301302
white-space: pre }
302303

303-
span.problematic {
304+
span.problematic, pre.problematic {
304305
color: red }
305306

306307
span.section-subtitle {
@@ -368,7 +369,7 @@ <h1 class="title">Stock Move Line Reference Link</h1>
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369370
!! source digest: sha256:e62c86340f5fed7cc18d6605fbf6719b109889d00b28c2fdd73bed413181cc7c
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_move_line_reference_link"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-17-0/stock-logistics-workflow-17-0-stock_move_line_reference_link"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_move_line_reference_link"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_move_line_reference_link"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372373
<p>This module adds link to references in stock move lines.</p>
373374
<p><strong>Table of contents</strong></p>
374375
<div class="contents local topic" id="contents">
@@ -387,7 +388,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
387388
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues">GitHub Issues</a>.
388389
In case of trouble, please check there if your issue has already been reported.
389390
If you spotted it first, help us to smash it by providing a detailed and welcomed
390-
<a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_move_line_reference_link%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
391+
<a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_move_line_reference_link%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
391392
<p>Do not contact contributors directly about support or help with technical issues.</p>
392393
</div>
393394
<div class="section" id="credits">
@@ -402,16 +403,22 @@ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
402403
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
403404
<ul class="simple">
404405
<li>Miquel Raïch &lt;<a class="reference external" href="mailto:miquel.raich&#64;forgeflow.com">miquel.raich&#64;forgeflow.com</a>&gt;</li>
406+
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a><ul>
407+
<li>Bhavesh Heliconia</li>
408+
</ul>
409+
</li>
405410
</ul>
406411
</div>
407412
<div class="section" id="maintainers">
408413
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
409414
<p>This module is maintained by the OCA.</p>
410-
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
415+
<a class="reference external image-reference" href="https://odoo-community.org">
416+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
417+
</a>
411418
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
412419
mission is to support the collaborative development of Odoo features and
413420
promote its widespread use.</p>
414-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/17.0/stock_move_line_reference_link">OCA/stock-logistics-workflow</a> project on GitHub.</p>
421+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_move_line_reference_link">OCA/stock-logistics-workflow</a> project on GitHub.</p>
415422
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
416423
</div>
417424
</div>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import test_move_line
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
from odoo.tests.common import TransactionCase
2+
3+
4+
class TestStockMoveLine(TransactionCase):
5+
@classmethod
6+
def setUpClass(cls):
7+
super().setUpClass()
8+
# Set up required records for the test
9+
cls.product = cls.env["product.product"].create(
10+
{
11+
"name": "Test Product",
12+
"sale_line_warn": "no-message",
13+
}
14+
)
15+
cls.stock_location = cls.env["stock.location"].create(
16+
{
17+
"name": "Test Location",
18+
}
19+
)
20+
cls.picking_type = cls.env["stock.picking.type"].create(
21+
{"name": "Test Picking Type", "code": "outgoing", "sequence_code": "SPT"}
22+
)
23+
cls.picking = cls.env["stock.picking"].create(
24+
{
25+
"picking_type_id": cls.picking_type.id,
26+
"location_id": cls.stock_location.id,
27+
"location_dest_id": cls.stock_location.id,
28+
}
29+
)
30+
cls.move = cls.env["stock.move"].create(
31+
{
32+
"name": "Test Move",
33+
"product_id": cls.product.id,
34+
"product_uom_qty": 10,
35+
"location_id": cls.stock_location.id,
36+
"location_dest_id": cls.stock_location.id,
37+
"picking_id": cls.picking.id,
38+
}
39+
)
40+
cls.move_line = cls.env["stock.move.line"].create(
41+
{
42+
"product_id": cls.product.id,
43+
"move_id": cls.move.id,
44+
"location_id": cls.stock_location.id,
45+
"location_dest_id": cls.stock_location.id,
46+
}
47+
)
48+
49+
def test_linked_reference_with_picking(self):
50+
self.assertEqual(
51+
self.move_line.linked_reference,
52+
self.picking,
53+
"linked_reference should point to the picking when available",
54+
)
55+
56+
def test_linked_reference_with_move(self):
57+
self.move.picking_id = False
58+
self.move_line._compute_linked_reference()
59+
self.assertEqual(
60+
self.move_line.linked_reference,
61+
self.move,
62+
"linked_reference should point to the move when picking is not available",
63+
)
64+
65+
def test_linked_reference_no_reference(self):
66+
# Detach move reference entirely and test
67+
self.move_line.move_id = False
68+
self.move_line._compute_linked_reference() # Trigger compute manually
69+
self.assertFalse(
70+
self.move_line.linked_reference,
71+
"linked_reference should be False if no picking or move is available",
72+
)

0 commit comments

Comments
 (0)