Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] stock_location_lockdown: Migration to 18.0. #2209

Open
wants to merge 43 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
155aea6
Add module stock_location_lockdown for v9
florian-dacosta Sep 6, 2018
87fddd0
[MIG] stock_location_lockdown from v9 to v10
alexis-via Dec 5, 2018
776be31
[UPD] README.rst
OCA-git-bot Dec 10, 2018
704f8f2
[UPD] Update stock_location_lockdown.pot
oca-travis Dec 10, 2018
d7b1c96
Added translation using Weblate (Portuguese)
pedrocs-exo Dec 27, 2018
70691b7
[ADD] icon.png
OCA-git-bot Apr 3, 2019
566265a
[FIX] fix negative quant in blocked location
sebastienbeau Jul 5, 2019
4d67bdd
[UPD] Update stock_location_lockdown.pot
oca-travis Jul 8, 2019
1ee7186
stock_location_lockdown 10.0.1.1.0
OCA-git-bot Jul 8, 2019
8e5d3d4
Update translation files
oca-transbot Jul 20, 2019
8d9371b
[UPD] README.rst
OCA-git-bot Jul 29, 2019
fd1204d
[MIG] stock_location_lockdown : Migration to 12.0
clementmbr Sep 19, 2019
155e078
[UPD] Update stock_location_lockdown.pot
oca-travis Oct 1, 2019
0ba0485
[UPD] README.rst
OCA-git-bot Oct 1, 2019
9346cb9
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Oct 16, 2019
f6113fe
Update translation files
oca-transbot Oct 16, 2019
f06b115
[IMP] stock_location_lockdown: improve error message
alexis-via Dec 4, 2020
082f38c
stock_location_lockdown 12.0.1.1.0
OCA-git-bot Dec 7, 2020
73e7cb7
[IMP] stock_location_lockdown: black, isort, prettier
florian-dacosta Dec 17, 2020
3d866f6
[MIG] stock_location_lockdown: Migration to 14.0
florian-dacosta Dec 17, 2020
5acfea6
[UPD] Update stock_location_lockdown.pot
oca-travis Feb 16, 2021
fc79f77
[UPD] README.rst
OCA-git-bot Feb 16, 2021
d7f2441
[15.0][MIG] stock_location_lockdown: Migration to 15.0
BT-dmontull Mar 4, 2022
c67b5c5
[UPD] Update stock_location_lockdown.pot
Mar 18, 2022
8b2db6d
[UPD] README.rst
OCA-git-bot Mar 18, 2022
ad95810
stock_location_lockdown 15.0.1.0.1
OCA-git-bot Mar 18, 2022
7e77e95
[IMP] stock_location_lockdown: pre-commit stuff
Urvisha-OSI Mar 23, 2023
b84c276
[MIG] stock_location_lockdown: Migration to 16.0
Urvisha-OSI Mar 23, 2023
7f864d6
[UPD] Update stock_location_lockdown.pot
Apr 28, 2023
c595186
[UPD] README.rst
OCA-git-bot Apr 28, 2023
945a423
Update translation files
weblate Apr 28, 2023
cdde824
Added translation using Weblate (Spanish)
Ivorra78 Jul 27, 2023
7468296
[UPD] README.rst
OCA-git-bot Sep 3, 2023
95ef114
Update translation files
weblate Oct 9, 2023
fe26801
Added translation using Weblate (Italian)
mymage Nov 17, 2023
d7b3688
[IMP] stock_location_lockdown: pre-commit auto fixes
celm1990 Feb 19, 2024
fde4a8d
[MIG] stock_location_lockdown: Migration to 17.0
celm1990 Feb 19, 2024
faf8fff
[UPD] Update stock_location_lockdown.pot
Jul 16, 2024
474d91b
[BOT] post-merge updates
OCA-git-bot Jul 16, 2024
3b28a5a
Update translation files
weblate Jul 16, 2024
fff1196
Translated using Weblate (Spanish)
florenciafrigieri2 Aug 22, 2024
e9b7a9b
[IMP] stock_location_lockdown: pre-commit execution
ced-adhoc Dec 2, 2024
7a6bdea
[18.0][MIG] stock_location_lockdown: Migration to 18.0
ced-adhoc Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions stock_location_lockdown/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Stock Location Lockdown
: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/17.0/stock_location_lockdown
:target: https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_location_lockdown
: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-17-0/stock-logistics-warehouse-17-0-stock_location_lockdown
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-18-0/stock-logistics-warehouse-18-0-stock_location_lockdown
: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=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -49,17 +49,17 @@ for these locations.
Usage
=====

- Once the module is installed, select any internal location for which
you want to prevent stock entrance and check the box *Block Stock
Entrance*. Then, you won't be allow to add stock on these locations.
- Once the module is installed, select any internal location for which
you want to prevent stock entrance and check the box *Block Stock
Entrance*. Then, you won't be allow to add stock on these locations.

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_location_lockdown%0Aversion:%2017.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_location_lockdown%0Aversion:%2018.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.

Expand All @@ -74,9 +74,9 @@ Authors
Contributors
------------

- Florian da Costa <[email protected]>
- David Montull Guasch <[email protected]>
- Urvisha Desai <[email protected]>
- Florian da Costa <[email protected]>
- David Montull Guasch <[email protected]>
- Urvisha Desai <[email protected]>

Maintainers
-----------
Expand All @@ -91,6 +91,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/17.0/stock_location_lockdown>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_location_lockdown>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion stock_location_lockdown/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"application": False,
"installable": True,
Expand Down
10 changes: 5 additions & 5 deletions stock_location_lockdown/models/stock_location.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Copyright 2019 Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, fields, models
from odoo import fields, models
from odoo.exceptions import UserError


class StockLocation(models.Model):
_inherit = "stock.location"

block_stock_entrance = fields.Boolean(
help="if this box is checked, putting stock on this location won't be "
"allowed. Usually used for a virtual location that has "
"childrens."
help="If this box is checked, putting stock on this location won't be "
"allowed. Use this to temporarily block stock movements or to enforce "
ced-adhoc marked this conversation as resolved.
Show resolved Hide resolved
"restrictions in both physical and virtual locations."
)

# Raise error if the location that you're trying to block
Expand All @@ -25,7 +25,7 @@ def write(self, values):
self.env["stock.quant"]._unlink_zero_quants()
if self.mapped("quant_ids"):
raise UserError(
_(
self.env._(
"It is impossible to prohibit this location from\
receiving products as it already contains some."
)
Expand Down
4 changes: 2 additions & 2 deletions stock_location_lockdown/models/stock_quant.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, api, models
from odoo import api, models
from odoo.exceptions import ValidationError


Expand All @@ -15,7 +15,7 @@ def check_location_blocked(self):
for record in self:
if record.location_id.block_stock_entrance:
raise ValidationError(
_(
self.env._(
"The location %(location)s is blocked and can "
"not be used for moving the product %(product)s"
)
Expand Down
9 changes: 7 additions & 2 deletions stock_location_lockdown/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
The aim of this module is to mark internal locations where no product
should transit. Indeed, in complex warehouse setups, we may have a
The aim of this module is to provide a way to mark internal locations where product storage is disallowed.
This feature is versatile and can be used in various scenarios, such as:

- Temporarily blocking stock movement to specific locations.
- Preventing stock from being stored in locations not meant for physical storage.

Indeed, in complex warehouse setups, we may have a
complicated tree of internal locations with parent locations only used
to create the hierarchy of the internal locations. We may want to avoid
to put stock on these parent internal locations since they are not
Expand Down
6 changes: 3 additions & 3 deletions stock_location_lockdown/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Stock Location Lockdown</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:652bdf4838b6338f49a04b39293e40cfad57f3576537e4c50cd027f8714a7a39
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/17.0/stock_location_lockdown"><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-17-0/stock-logistics-warehouse-17-0-stock_location_lockdown"><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=17.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/18.0/stock_location_lockdown"><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-18-0/stock-logistics-warehouse-18-0-stock_location_lockdown"><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=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>The aim of this module is to mark internal locations where no product
should transit. Indeed, in complex warehouse setups, we may have a
complicated tree of internal locations with parent locations only used
Expand Down Expand Up @@ -408,7 +408,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<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_location_lockdown%0Aversion:%2017.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_location_lockdown%0Aversion:%2018.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">
Expand Down Expand Up @@ -436,7 +436,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<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/17.0/stock_location_lockdown">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/18.0/stock_location_lockdown">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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ def test_transfer_stock_out_locked_location(self):
"product_id": self.product.id,
"product_uom_id": self.product.uom_id.id,
"quantity": self.product.qty_available + 1,
"location_id": self.supplier_location.id,
"location_dest_id": self.new_stock_location.id,
"location_id": self.new_stock_location.id,
"location_dest_id": self.customer_location.id,
},
)
],
}
stock_move = self.env["stock.move"].create(move_vals)

with self.assertRaises(ValidationError):
stock_move._action_done()
self.env["stock.move"].create(move_vals)

def test_block_location_with_quants(self):
"""
Expand Down
Loading