[MIG] stock_removal_location_by_priority: Migration to 16.0

This commit is contained in:
Aritz Olea
2023-11-21 10:36:20 +01:00
parent c283c8e629
commit a29c7edce6
7 changed files with 21 additions and 20 deletions

View File

@@ -7,7 +7,7 @@ Stock Removal Location by Priority
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:778ff616ca9d089ad75e8bccc6ad8d85999534733f7e90988533944d1ce95d12
!! source digest: sha256:5a11cbda4c26dfde12e89780b1ad4f8e74cf6e5f821e80c759c837dc0772a814
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Stock Removal Location by Priority
: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/14.0/stock_removal_location_by_priority
:target: https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_removal_location_by_priority
: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-14-0/stock-logistics-warehouse-14-0-stock_removal_location_by_priority
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_removal_location_by_priority
: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=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -68,7 +68,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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 <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_removal_location_by_priority%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_removal_location_by_priority%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -86,6 +86,7 @@ Contributors
* Miquel Raïch <miquel.raich@forgeflow.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
* Aritz Olea <aritz.olea@factorlibre.com>
Maintainers
~~~~~~~~~~~
@@ -100,6 +101,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 <https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_removal_location_by_priority>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_removal_location_by_priority>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,7 +4,7 @@
{
"name": "Stock Removal Location by Priority",
"summary": "Establish a removal priority on stock locations.",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"author": "ForgeFlow, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",

View File

@@ -9,7 +9,6 @@ class StockLocation(models.Model):
_inherit = "stock.location"
removal_priority = fields.Integer(
string="Removal Priority",
default=10,
help="This priority applies when removing stock and incoming dates are equal.",
)

View File

@@ -19,9 +19,9 @@ class StockQuant(models.Model):
"stock_removal_location_by_priority.group_removal_priority"
):
if removal_strategy == "fifo":
return "in_date ASC NULLS FIRST, removal_priority ASC, id"
return "in_date ASC, removal_priority ASC, id"
elif removal_strategy == "lifo":
return "in_date DESC NULLS LAST, removal_priority ASC, id desc"
return "in_date DESC, removal_priority ASC, id desc"
raise UserError(
_("Removal strategy %s not implemented.") % (removal_strategy,)
)

View File

@@ -1,3 +1,4 @@
* Miquel Raïch <miquel.raich@forgeflow.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
* Aritz Olea <aritz.olea@factorlibre.com>

View File

@@ -367,9 +367,9 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:778ff616ca9d089ad75e8bccc6ad8d85999534733f7e90988533944d1ce95d12
!! source digest: sha256:5a11cbda4c26dfde12e89780b1ad4f8e74cf6e5f821e80c759c837dc0772a814
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_removal_location_by_priority"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_removal_location_by_priority"><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-warehouse&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_removal_location_by_priority"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_removal_location_by_priority"><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-warehouse&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds a removal priority field on stock locations.
This priority applies when removing a product from different stock locations
and the incoming dates are equal in both locations.</p>
@@ -417,7 +417,7 @@ use FIFO or LIFO removal strategy.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_removal_location_by_priority%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_removal_location_by_priority%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -434,6 +434,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<li>Miquel Raïch &lt;<a class="reference external" href="mailto:miquel.raich&#64;forgeflow.com">miquel.raich&#64;forgeflow.com</a>&gt;</li>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
<li>Aritz Olea &lt;<a class="reference external" href="mailto:aritz.olea&#64;factorlibre.com">aritz.olea&#64;factorlibre.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -443,7 +444,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_removal_location_by_priority">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_removal_location_by_priority">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<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>
</div>
</div>

View File

@@ -4,6 +4,7 @@
from datetime import date
from odoo import Command
from odoo.tests.common import TransactionCase
@@ -93,10 +94,8 @@ class TestStockRemovalLocationByPriority(TransactionCase):
"picking_type_id": picking_type.id,
"location_id": location.id,
"location_dest_id": location_dest.id,
"move_lines": [
(
0,
0,
"move_ids": [
Command.create(
{
"name": "Test move",
"product_id": self.product_1.id,
@@ -126,7 +125,7 @@ class TestStockRemovalLocationByPriority(TransactionCase):
picking_1 = self._create_picking(
self.picking_internal, self.stock, self.stock_2, 5
)
picking_1.flush()
picking_1.flush_model()
picking_1.action_confirm()
picking_1.action_assign()
@@ -151,7 +150,7 @@ class TestStockRemovalLocationByPriority(TransactionCase):
picking_1 = self._create_picking(
self.picking_internal, self.stock, self.stock_2, 5
)
picking_1.flush()
picking_1.flush_model()
picking_1.action_confirm()
picking_1.action_assign()