Skip to content

Commit 786424f

Browse files
eantonesdeeniiz
authored andcommitted
[WIP][MIG] stock_putaway_no_internal: Migration to 18.0
1 parent 4ff6f9a commit 786424f

File tree

14 files changed

+724
-0
lines changed

14 files changed

+724
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
============================
2+
Putaway strategy no internal
3+
============================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:ae589b685e4bc3f3daf8aedd9ffc3bbe481bfd21d8b4450768f3f1f623d9f4cf
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-NuoBiT%2Fodoo--addons-lightgray.png?logo=github
20+
:target: https://github.com/NuoBiT/odoo-addons/tree/18.0/stock_putaway_no_internal
21+
:alt: NuoBiT/odoo-addons
22+
23+
|badge1| |badge2| |badge3|
24+
25+
Allow to exclude putaway strategies if they are applied on an internal
26+
operations
27+
28+
**Table of contents**
29+
30+
.. contents::
31+
:local:
32+
33+
Bug Tracker
34+
===========
35+
36+
Bugs are tracked on `GitHub Issues <https://github.com/NuoBiT/odoo-addons/issues>`_.
37+
In case of trouble, please check there if your issue has already been reported.
38+
If you spotted it first, help us to smash it by providing a detailed and welcomed
39+
`feedback <https://github.com/NuoBiT/odoo-addons/issues/new?body=module:%20stock_putaway_no_internal%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
40+
41+
Do not contact contributors directly about support or help with technical issues.
42+
43+
Credits
44+
=======
45+
46+
Authors
47+
-------
48+
49+
* NuoBiT Solutions SL
50+
51+
Contributors
52+
------------
53+
54+
- `NuoBiT <https://www.nuobit.com>`__:
55+
56+
- Eric Antones eantones@nuobit.com
57+
- Deniz Gallo dgallo@nuobit.com
58+
59+
Maintainers
60+
-----------
61+
62+
.. |maintainer-eantones| image:: https://github.com/eantones.png?size=40px
63+
:target: https://github.com/eantones
64+
:alt: eantones
65+
66+
Current maintainer:
67+
68+
|maintainer-eantones|
69+
70+
This module is part of the `NuoBiT/odoo-addons <https://github.com/NuoBiT/odoo-addons/tree/18.0/stock_putaway_no_internal>`_ project on GitHub.
71+
72+
You are welcome to contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright NuoBiT Solutions - Eric Antones <eantones@nuobit.com>
2+
# Copyright 2025 NuoBiT Solutions - Deniz Gallo <dgallo@nuobit.com>
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
4+
5+
{
6+
"name": "Putaway strategy no internal",
7+
"summary": "Allow to exclude putaway strategies "
8+
"if they are applied on an internal operations",
9+
"version": "18.0.1.0.0",
10+
"category": "Warehouse Management",
11+
"license": "AGPL-3",
12+
"author": "NuoBiT Solutions SL",
13+
"website": "https://github.com/NuoBiT/odoo-addons",
14+
"depends": [
15+
"stock",
16+
],
17+
"data": [
18+
"views/stock_putaway_rule_views.xml",
19+
],
20+
"development_status": "Beta",
21+
"maintainers": ["eantones"],
22+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * stock_putaway_no_internal
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2021-12-16 16:28+0000\n"
10+
"PO-Revision-Date: 2021-12-16 16:28+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: stock_putaway_no_internal
19+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_location__display_name
20+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_move__display_name
21+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule__display_name
22+
msgid "Display Name"
23+
msgstr "Nom a mostrar"
24+
25+
#. module: stock_putaway_no_internal
26+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule__exclude_internal_operations
27+
msgid "Exclude internal operations"
28+
msgstr "Excloure operacions internes"
29+
30+
#. module: stock_putaway_no_internal
31+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_location__id
32+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_move__id
33+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule__id
34+
msgid "ID"
35+
msgstr ""
36+
37+
#. module: stock_putaway_no_internal
38+
#: model:ir.model,name:stock_putaway_no_internal.model_stock_location
39+
msgid "Inventory Locations"
40+
msgstr "Ubicacions d'inventari"
41+
42+
#. module: stock_putaway_no_internal
43+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_location____last_update
44+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_move____last_update
45+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule____last_update
46+
msgid "Last Modified on"
47+
msgstr "Última modificació el "
48+
49+
#. module: stock_putaway_no_internal
50+
#: code:addons/stock_putaway_no_internal/models/stock_location.py:0
51+
#, python-format
52+
msgid "No picking type defined in context"
53+
msgstr ""
54+
55+
#. module: stock_putaway_no_internal
56+
#: model:ir.model,name:stock_putaway_no_internal.model_stock_putaway_rule
57+
msgid "Putaway Rule"
58+
msgstr ""
59+
60+
#. module: stock_putaway_no_internal
61+
#: model:ir.model,name:stock_putaway_no_internal.model_stock_move
62+
msgid "Stock Move"
63+
msgstr "Moviment d'estoc"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * stock_putaway_no_internal
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2021-12-16 16:29+0000\n"
10+
"PO-Revision-Date: 2021-12-16 16:29+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: \n"
17+
18+
#. module: stock_putaway_no_internal
19+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_location__display_name
20+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_move__display_name
21+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule__display_name
22+
msgid "Display Name"
23+
msgstr "Nombre mostrado"
24+
25+
#. module: stock_putaway_no_internal
26+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule__exclude_internal_operations
27+
msgid "Exclude internal operations"
28+
msgstr "Excluir operaciones internas"
29+
30+
#. module: stock_putaway_no_internal
31+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_location__id
32+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_move__id
33+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule__id
34+
msgid "ID"
35+
msgstr ""
36+
37+
#. module: stock_putaway_no_internal
38+
#: model:ir.model,name:stock_putaway_no_internal.model_stock_location
39+
msgid "Inventory Locations"
40+
msgstr "Ubicaciones de inventario"
41+
42+
#. module: stock_putaway_no_internal
43+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_location____last_update
44+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_move____last_update
45+
#: model:ir.model.fields,field_description:stock_putaway_no_internal.field_stock_putaway_rule____last_update
46+
msgid "Last Modified on"
47+
msgstr "Última modificación el"
48+
49+
#. module: stock_putaway_no_internal
50+
#: code:addons/stock_putaway_no_internal/models/stock_location.py:0
51+
#, python-format
52+
msgid "No picking type defined in context"
53+
msgstr ""
54+
55+
#. module: stock_putaway_no_internal
56+
#: model:ir.model,name:stock_putaway_no_internal.model_stock_putaway_rule
57+
msgid "Putaway Rule"
58+
msgstr "Regla de Estrategia de Traslado"
59+
60+
#. module: stock_putaway_no_internal
61+
#: model:ir.model,name:stock_putaway_no_internal.model_stock_move
62+
msgid "Stock Move"
63+
msgstr "Movimiento de existencias"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import stock_move
2+
from . import stock_putaway_rule
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright NuoBiT Solutions - Eric Antones <eantones@nuobit.com>
2+
# Copyright 2025 NuoBiT Solutions - Deniz Gallo <dgallo@nuobit.com>
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
4+
5+
from odoo import models
6+
7+
8+
class StockMove(models.Model):
9+
_inherit = "stock.move"
10+
11+
def prepare_move_line_vals(self, quantity=None, reserved_quant=None):
12+
return super(
13+
StockMove,
14+
self.with_context(stock_picking_type_code=self.picking_type_id.code),
15+
).prepare_move_line_vals(quantity=quantity, reserved_quant=reserved_quant)
16+
17+
18+
class StockMoveLine(models.Model):
19+
_inherit = "stock.move.line"
20+
21+
def _apply_putaway_strategy(self):
22+
picking_code = self.picking_id.picking_type_id.code
23+
return super(
24+
StockMoveLine, self.with_context(stock_picking_type_code=picking_code)
25+
)._apply_putaway_strategy()
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright NuoBiT Solutions - Eric Antones <eantones@nuobit.com>
2+
# Copyright 2025 NuoBiT Solutions - Deniz Gallo <dgallo@nuobit.com>
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
4+
5+
from odoo import fields, models
6+
7+
8+
class StockPutawayRule(models.Model):
9+
_inherit = "stock.putaway.rule"
10+
11+
exclude_internal_operations = fields.Boolean(
12+
string="Exclude internal operations", default=False
13+
)
14+
15+
def _excluded_picking_types(self):
16+
return ["internal"]
17+
18+
def _get_putaway_location(
19+
self, product, quantity=0, package=None, packaging=None, qty_by_location=None
20+
):
21+
picking_type_code = self.env.context.get("stock_picking_type_code", False)
22+
excluded_picking_types = self._excluded_picking_types()
23+
if (
24+
picking_type_code in excluded_picking_types
25+
and self.exclude_internal_operations
26+
):
27+
return self.env["stock.location"]
28+
return super()._get_putaway_location(
29+
product, quantity, package, packaging, qty_by_location
30+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [NuoBiT](https://www.nuobit.com):
2+
- Eric Antones <eantones@nuobit.com>
3+
- Deniz Gallo <dgallo@nuobit.com>

0 commit comments

Comments
 (0)