odoo-addon-stock-restrict-lot 16.0.1.1.0.8__py3-none-any.whl → 16.0.1.2.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of odoo-addon-stock-restrict-lot might be problematic. Click here for more details.
- odoo/addons/stock_restrict_lot/README.rst +10 -1
- odoo/addons/stock_restrict_lot/__manifest__.py +1 -1
- odoo/addons/stock_restrict_lot/i18n/es.po +14 -0
- odoo/addons/stock_restrict_lot/i18n/hr.po +16 -2
- odoo/addons/stock_restrict_lot/i18n/it.po +18 -2
- odoo/addons/stock_restrict_lot/i18n/stock_restrict_lot.pot +14 -0
- odoo/addons/stock_restrict_lot/models/__init__.py +1 -0
- odoo/addons/stock_restrict_lot/models/product_product.py +22 -0
- odoo/addons/stock_restrict_lot/models/stock_move.py +29 -1
- odoo/addons/stock_restrict_lot/readme/CONTRIBUTORS.rst +9 -0
- odoo/addons/stock_restrict_lot/static/description/index.html +17 -6
- odoo/addons/stock_restrict_lot/tests/test_restrict_lot.py +75 -0
- {odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info → odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info}/METADATA +12 -6
- odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info/RECORD +24 -0
- {odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info → odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info}/WHEEL +1 -1
- odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info/RECORD +0 -23
- {odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info → odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ Stock Restrict Lot
|
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
8
|
!! changes will be overwritten. !!
|
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
10
|
+
!! source digest: sha256:f43ca615da72d74e3eacdb15df13c3774cc89ee38985026febc26834c35cd556
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -61,6 +61,15 @@ Contributors
|
|
|
61
61
|
|
|
62
62
|
* Florian da Costa <florian.dacosta@akretion.com>
|
|
63
63
|
* Ruchir Shukla <ruchir@bizzappdev.com>
|
|
64
|
+
* Michael Tietz (MT Software) <mtietz@mt-software.de>
|
|
65
|
+
|
|
66
|
+
* Ooops404
|
|
67
|
+
|
|
68
|
+
* Francesco Foresti <francesco.foresti@ooops404.com>
|
|
69
|
+
|
|
70
|
+
* PyTech SRL
|
|
71
|
+
|
|
72
|
+
* Alessandro Uffreduzzi <alessandro.uffreduzzi@pytech.it>
|
|
64
73
|
|
|
65
74
|
Maintainers
|
|
66
75
|
~~~~~~~~~~~
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Stock Restrict Lot",
|
|
3
3
|
"summary": "Base module that add back the concept of restrict lot on stock move",
|
|
4
|
-
"version": "16.0.1.
|
|
4
|
+
"version": "16.0.1.2.0",
|
|
5
5
|
"category": "Warehouse Management",
|
|
6
6
|
"website": "https://github.com/OCA/stock-logistics-workflow",
|
|
7
7
|
"author": "Akretion, Odoo Community Association (OCA)",
|
|
@@ -31,6 +31,11 @@ msgstr ""
|
|
|
31
31
|
msgid "Lot"
|
|
32
32
|
msgstr "Lote"
|
|
33
33
|
|
|
34
|
+
#. module: stock_restrict_lot
|
|
35
|
+
#: model:ir.model,name:stock_restrict_lot.model_product_product
|
|
36
|
+
msgid "Product Variant"
|
|
37
|
+
msgstr ""
|
|
38
|
+
|
|
34
39
|
#. module: stock_restrict_lot
|
|
35
40
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_move__restrict_lot_id
|
|
36
41
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_picking__restrict_lot_id
|
|
@@ -47,6 +52,15 @@ msgstr "Movimiento de Existencias"
|
|
|
47
52
|
msgid "Stock Rule"
|
|
48
53
|
msgstr "Regla de Existencias"
|
|
49
54
|
|
|
55
|
+
#. module: stock_restrict_lot
|
|
56
|
+
#. odoo-python
|
|
57
|
+
#: code:addons/stock_restrict_lot/models/stock_move.py:0
|
|
58
|
+
#, python-format
|
|
59
|
+
msgid ""
|
|
60
|
+
"The lot(s) %(move_line_lot)s being moved is inconsistent with the "
|
|
61
|
+
"restriction on lot %(move_restrict_lot)s set on the move"
|
|
62
|
+
msgstr ""
|
|
63
|
+
|
|
50
64
|
#. module: stock_restrict_lot
|
|
51
65
|
#: model:ir.model,name:stock_restrict_lot.model_stock_picking
|
|
52
66
|
msgid "Transfer"
|
|
@@ -13,8 +13,8 @@ msgstr ""
|
|
|
13
13
|
"MIME-Version: 1.0\n"
|
|
14
14
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
15
15
|
"Content-Transfer-Encoding: \n"
|
|
16
|
-
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 &&
|
|
17
|
-
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
|
16
|
+
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
|
|
17
|
+
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
|
18
18
|
"X-Generator: Weblate 4.17\n"
|
|
19
19
|
|
|
20
20
|
#. module: stock_restrict_lot
|
|
@@ -32,6 +32,11 @@ msgstr ""
|
|
|
32
32
|
msgid "Lot"
|
|
33
33
|
msgstr "Lot"
|
|
34
34
|
|
|
35
|
+
#. module: stock_restrict_lot
|
|
36
|
+
#: model:ir.model,name:stock_restrict_lot.model_product_product
|
|
37
|
+
msgid "Product Variant"
|
|
38
|
+
msgstr ""
|
|
39
|
+
|
|
35
40
|
#. module: stock_restrict_lot
|
|
36
41
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_move__restrict_lot_id
|
|
37
42
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_picking__restrict_lot_id
|
|
@@ -48,6 +53,15 @@ msgstr "Skladišno kretanje"
|
|
|
48
53
|
msgid "Stock Rule"
|
|
49
54
|
msgstr "Skladišno pravilo"
|
|
50
55
|
|
|
56
|
+
#. module: stock_restrict_lot
|
|
57
|
+
#. odoo-python
|
|
58
|
+
#: code:addons/stock_restrict_lot/models/stock_move.py:0
|
|
59
|
+
#, python-format
|
|
60
|
+
msgid ""
|
|
61
|
+
"The lot(s) %(move_line_lot)s being moved is inconsistent with the "
|
|
62
|
+
"restriction on lot %(move_restrict_lot)s set on the move"
|
|
63
|
+
msgstr ""
|
|
64
|
+
|
|
51
65
|
#. module: stock_restrict_lot
|
|
52
66
|
#: model:ir.model,name:stock_restrict_lot.model_stock_picking
|
|
53
67
|
msgid "Transfer"
|
|
@@ -6,7 +6,7 @@ msgid ""
|
|
|
6
6
|
msgstr ""
|
|
7
7
|
"Project-Id-Version: Odoo Server 16.0\n"
|
|
8
8
|
"Report-Msgid-Bugs-To: \n"
|
|
9
|
-
"PO-Revision-Date:
|
|
9
|
+
"PO-Revision-Date: 2024-09-18 16:06+0000\n"
|
|
10
10
|
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
|
|
11
11
|
"Language-Team: none\n"
|
|
12
12
|
"Language: it\n"
|
|
@@ -14,7 +14,7 @@ msgstr ""
|
|
|
14
14
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
15
15
|
"Content-Transfer-Encoding: \n"
|
|
16
16
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
|
17
|
-
"X-Generator: Weblate
|
|
17
|
+
"X-Generator: Weblate 5.6.2\n"
|
|
18
18
|
|
|
19
19
|
#. module: stock_restrict_lot
|
|
20
20
|
#. odoo-python
|
|
@@ -31,6 +31,11 @@ msgstr ""
|
|
|
31
31
|
msgid "Lot"
|
|
32
32
|
msgstr "Lotto"
|
|
33
33
|
|
|
34
|
+
#. module: stock_restrict_lot
|
|
35
|
+
#: model:ir.model,name:stock_restrict_lot.model_product_product
|
|
36
|
+
msgid "Product Variant"
|
|
37
|
+
msgstr "Variante prodotto"
|
|
38
|
+
|
|
34
39
|
#. module: stock_restrict_lot
|
|
35
40
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_move__restrict_lot_id
|
|
36
41
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_picking__restrict_lot_id
|
|
@@ -47,6 +52,17 @@ msgstr "Movimento di magazzino"
|
|
|
47
52
|
msgid "Stock Rule"
|
|
48
53
|
msgstr "Regola di giacenza"
|
|
49
54
|
|
|
55
|
+
#. module: stock_restrict_lot
|
|
56
|
+
#. odoo-python
|
|
57
|
+
#: code:addons/stock_restrict_lot/models/stock_move.py:0
|
|
58
|
+
#, python-format
|
|
59
|
+
msgid ""
|
|
60
|
+
"The lot(s) %(move_line_lot)s being moved is inconsistent with the "
|
|
61
|
+
"restriction on lot %(move_restrict_lot)s set on the move"
|
|
62
|
+
msgstr ""
|
|
63
|
+
"Il lotto %(move_line_lot)s che si sta movimentando è inconsistente con la "
|
|
64
|
+
"restrizione sul lotto %(move_restrict_lot)s impostato nel movimento"
|
|
65
|
+
|
|
50
66
|
#. module: stock_restrict_lot
|
|
51
67
|
#: model:ir.model,name:stock_restrict_lot.model_stock_picking
|
|
52
68
|
msgid "Transfer"
|
|
@@ -26,6 +26,11 @@ msgstr ""
|
|
|
26
26
|
msgid "Lot"
|
|
27
27
|
msgstr ""
|
|
28
28
|
|
|
29
|
+
#. module: stock_restrict_lot
|
|
30
|
+
#: model:ir.model,name:stock_restrict_lot.model_product_product
|
|
31
|
+
msgid "Product Variant"
|
|
32
|
+
msgstr ""
|
|
33
|
+
|
|
29
34
|
#. module: stock_restrict_lot
|
|
30
35
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_move__restrict_lot_id
|
|
31
36
|
#: model:ir.model.fields,field_description:stock_restrict_lot.field_stock_picking__restrict_lot_id
|
|
@@ -42,6 +47,15 @@ msgstr ""
|
|
|
42
47
|
msgid "Stock Rule"
|
|
43
48
|
msgstr ""
|
|
44
49
|
|
|
50
|
+
#. module: stock_restrict_lot
|
|
51
|
+
#. odoo-python
|
|
52
|
+
#: code:addons/stock_restrict_lot/models/stock_move.py:0
|
|
53
|
+
#, python-format
|
|
54
|
+
msgid ""
|
|
55
|
+
"The lot(s) %(move_line_lot)s being moved is inconsistent with the "
|
|
56
|
+
"restriction on lot %(move_restrict_lot)s set on the move"
|
|
57
|
+
msgstr ""
|
|
58
|
+
|
|
45
59
|
#. module: stock_restrict_lot
|
|
46
60
|
#: model:ir.model,name:stock_restrict_lot.model_stock_picking
|
|
47
61
|
msgid "Transfer"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Copyright 2023 Michael Tietz (MT Software) <mtietz@mt-software.de>
|
|
2
|
+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
+
from odoo import models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ProductProduct(models.Model):
|
|
7
|
+
_inherit = "product.product"
|
|
8
|
+
|
|
9
|
+
# To be able to get the outgoing and incoming qty by the restrict_lot_id
|
|
10
|
+
# the odoo standard method _compute_quantities_dict is hookable
|
|
11
|
+
# therefore the domain is already here changed
|
|
12
|
+
def _get_domain_locations(self):
|
|
13
|
+
res = super()._get_domain_locations()
|
|
14
|
+
lot_id = self.env.context.get("lot_id")
|
|
15
|
+
if not lot_id:
|
|
16
|
+
return res
|
|
17
|
+
|
|
18
|
+
domain_quant_loc, domain_move_in_loc, domain_move_out_loc = res
|
|
19
|
+
lot_domain = [("restrict_lot_id", "=", lot_id)]
|
|
20
|
+
domain_move_in_loc += lot_domain
|
|
21
|
+
domain_move_out_loc += lot_domain
|
|
22
|
+
return domain_quant_loc, domain_move_in_loc, domain_move_out_loc
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from odoo import _, api, exceptions, fields, models
|
|
2
|
+
from odoo.exceptions import UserError
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class StockMove(models.Model):
|
|
@@ -7,7 +8,9 @@ class StockMove(models.Model):
|
|
|
7
8
|
# seems better to not copy this field except when a move is splitted, because a move
|
|
8
9
|
# can be copied in multiple different occasions and could even be copied with a
|
|
9
10
|
# different product...
|
|
10
|
-
restrict_lot_id = fields.Many2one(
|
|
11
|
+
restrict_lot_id = fields.Many2one(
|
|
12
|
+
"stock.lot", string="Restrict Lot", copy=False, index=True
|
|
13
|
+
)
|
|
11
14
|
|
|
12
15
|
def _prepare_procurement_values(self):
|
|
13
16
|
vals = super()._prepare_procurement_values()
|
|
@@ -88,3 +91,28 @@ class StockMove(models.Model):
|
|
|
88
91
|
if vals_list and self.restrict_lot_id:
|
|
89
92
|
vals_list[0]["restrict_lot_id"] = self.restrict_lot_id.id
|
|
90
93
|
return vals_list
|
|
94
|
+
|
|
95
|
+
def _action_done(self, cancel_backorder=False):
|
|
96
|
+
res = super()._action_done(cancel_backorder=cancel_backorder)
|
|
97
|
+
self._check_lot_consistent_with_restriction()
|
|
98
|
+
return res
|
|
99
|
+
|
|
100
|
+
def _check_lot_consistent_with_restriction(self):
|
|
101
|
+
"""
|
|
102
|
+
Check that the lot set on move lines
|
|
103
|
+
is the same as the restricted lot set on the move
|
|
104
|
+
"""
|
|
105
|
+
for move in self:
|
|
106
|
+
if not (move.restrict_lot_id and move.move_line_ids):
|
|
107
|
+
continue
|
|
108
|
+
move_line_lot = move.mapped("move_line_ids.lot_id")
|
|
109
|
+
if move.restrict_lot_id != move_line_lot:
|
|
110
|
+
raise UserError(
|
|
111
|
+
_(
|
|
112
|
+
"The lot(s) %(move_line_lot)s being moved is "
|
|
113
|
+
"inconsistent with the restriction on "
|
|
114
|
+
"lot %(move_restrict_lot)s set on the move",
|
|
115
|
+
move_line_lot=", ".join(move_line_lot.mapped("display_name")),
|
|
116
|
+
move_restrict_lot=move.restrict_lot_id.display_name,
|
|
117
|
+
)
|
|
118
|
+
)
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
* Florian da Costa <florian.dacosta@akretion.com>
|
|
2
2
|
* Ruchir Shukla <ruchir@bizzappdev.com>
|
|
3
|
+
* Michael Tietz (MT Software) <mtietz@mt-software.de>
|
|
4
|
+
|
|
5
|
+
* Ooops404
|
|
6
|
+
|
|
7
|
+
* Francesco Foresti <francesco.foresti@ooops404.com>
|
|
8
|
+
|
|
9
|
+
* PyTech SRL
|
|
10
|
+
|
|
11
|
+
* Alessandro Uffreduzzi <alessandro.uffreduzzi@pytech.it>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
2
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
3
|
<head>
|
|
@@ -9,10 +8,11 @@
|
|
|
9
8
|
|
|
10
9
|
/*
|
|
11
10
|
:Author: David Goodger (goodger@python.org)
|
|
12
|
-
:Id: $Id: html4css1.css
|
|
11
|
+
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
|
13
12
|
:Copyright: This stylesheet has been placed in the public domain.
|
|
14
13
|
|
|
15
14
|
Default cascading style sheet for the HTML output of Docutils.
|
|
15
|
+
Despite the name, some widely supported CSS2 features are used.
|
|
16
16
|
|
|
17
17
|
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
|
18
18
|
customize this style sheet.
|
|
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|
|
275
275
|
margin-left: 2em ;
|
|
276
276
|
margin-right: 2em }
|
|
277
277
|
|
|
278
|
-
pre.code .ln { color:
|
|
278
|
+
pre.code .ln { color: gray; } /* line numbers */
|
|
279
279
|
pre.code, code { background-color: #eeeeee }
|
|
280
280
|
pre.code .comment, code .comment { color: #5C6576 }
|
|
281
281
|
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
|
@@ -301,7 +301,7 @@ span.option {
|
|
|
301
301
|
span.pre {
|
|
302
302
|
white-space: pre }
|
|
303
303
|
|
|
304
|
-
span.problematic {
|
|
304
|
+
span.problematic, pre.problematic {
|
|
305
305
|
color: red }
|
|
306
306
|
|
|
307
307
|
span.section-subtitle {
|
|
@@ -367,7 +367,7 @@ ul.auto-toc {
|
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
368
|
!! changes will be overwritten. !!
|
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
370
|
+
!! source digest: sha256:f43ca615da72d74e3eacdb15df13c3774cc89ee38985026febc26834c35cd556
|
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
372
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/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-workflow/tree/16.0/stock_restrict_lot"><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-16-0/stock-logistics-workflow-16-0-stock_restrict_lot"><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&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
373
|
<p>This module add a field to restrict a stock move to a specific lot.
|
|
@@ -407,12 +407,23 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|
|
407
407
|
<ul class="simple">
|
|
408
408
|
<li>Florian da Costa <<a class="reference external" href="mailto:florian.dacosta@akretion.com">florian.dacosta@akretion.com</a>></li>
|
|
409
409
|
<li>Ruchir Shukla <<a class="reference external" href="mailto:ruchir@bizzappdev.com">ruchir@bizzappdev.com</a>></li>
|
|
410
|
+
<li>Michael Tietz (MT Software) <<a class="reference external" href="mailto:mtietz@mt-software.de">mtietz@mt-software.de</a>></li>
|
|
411
|
+
<li>Ooops404<ul>
|
|
412
|
+
<li>Francesco Foresti <<a class="reference external" href="mailto:francesco.foresti@ooops404.com">francesco.foresti@ooops404.com</a>></li>
|
|
413
|
+
</ul>
|
|
414
|
+
</li>
|
|
415
|
+
<li>PyTech SRL<ul>
|
|
416
|
+
<li>Alessandro Uffreduzzi <<a class="reference external" href="mailto:alessandro.uffreduzzi@pytech.it">alessandro.uffreduzzi@pytech.it</a>></li>
|
|
417
|
+
</ul>
|
|
418
|
+
</li>
|
|
410
419
|
</ul>
|
|
411
420
|
</div>
|
|
412
421
|
<div class="section" id="maintainers">
|
|
413
422
|
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
|
|
414
423
|
<p>This module is maintained by the OCA.</p>
|
|
415
|
-
<a class="reference external image-reference" href="https://odoo-community.org"
|
|
424
|
+
<a class="reference external image-reference" href="https://odoo-community.org">
|
|
425
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
426
|
+
</a>
|
|
416
427
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|
417
428
|
mission is to support the collaborative development of Odoo features and
|
|
418
429
|
promote its widespread use.</p>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from odoo.exceptions import UserError
|
|
1
2
|
from odoo.tests.common import TransactionCase
|
|
2
3
|
|
|
3
4
|
|
|
@@ -224,3 +225,77 @@ class TestRestrictLot(TransactionCase):
|
|
|
224
225
|
assert_move_line_per_lot_and_location(
|
|
225
226
|
pick.move_line_ids_without_package, lot2, location_2, 25
|
|
226
227
|
)
|
|
228
|
+
|
|
229
|
+
def test_compute_quantites(self):
|
|
230
|
+
move = self.env["stock.move"].create(
|
|
231
|
+
{
|
|
232
|
+
"product_id": self.product.id,
|
|
233
|
+
"location_id": self.output_loc.id,
|
|
234
|
+
"location_dest_id": self.customer_loc.id,
|
|
235
|
+
"product_uom_qty": 1,
|
|
236
|
+
"product_uom": self.product.uom_id.id,
|
|
237
|
+
"name": "test",
|
|
238
|
+
"procure_method": "make_to_order",
|
|
239
|
+
"warehouse_id": self.warehouse.id,
|
|
240
|
+
"route_ids": [(6, 0, self.warehouse.delivery_route_id.ids)],
|
|
241
|
+
"restrict_lot_id": self.lot.id,
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
move._action_confirm()
|
|
245
|
+
|
|
246
|
+
lot2 = self.lot.copy({"name": "lot2"})
|
|
247
|
+
move2 = move.copy()
|
|
248
|
+
move2.restrict_lot_id = lot2.id
|
|
249
|
+
move2._action_confirm()
|
|
250
|
+
|
|
251
|
+
product = move.product_id
|
|
252
|
+
self.assertEqual(product.outgoing_qty, 2)
|
|
253
|
+
product.invalidate_cache()
|
|
254
|
+
product = product.with_context(lot_id=self.lot.id)
|
|
255
|
+
self.assertEqual(product.outgoing_qty, 1)
|
|
256
|
+
|
|
257
|
+
product.invalidate_cache()
|
|
258
|
+
product = product.with_context(lot_id=lot2.id)
|
|
259
|
+
self.assertEqual(product.outgoing_qty, 1)
|
|
260
|
+
|
|
261
|
+
def test_move_validation_inconsistent_lot(self):
|
|
262
|
+
"""
|
|
263
|
+
Check that an error is raised when performing a move _action_done()
|
|
264
|
+
if the lot restriction on the move is inconsistent with the
|
|
265
|
+
lot in the move line
|
|
266
|
+
"""
|
|
267
|
+
lot2 = self.env["stock.lot"].create(
|
|
268
|
+
{
|
|
269
|
+
"name": "lot2",
|
|
270
|
+
"product_id": self.product.id,
|
|
271
|
+
"company_id": self.warehouse.company_id.id,
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
self._update_product_stock(1, lot2.id)
|
|
275
|
+
|
|
276
|
+
move = self.env["stock.move"].create(
|
|
277
|
+
{
|
|
278
|
+
"product_id": self.product.id,
|
|
279
|
+
"location_id": self.warehouse.lot_stock_id.id,
|
|
280
|
+
"location_dest_id": self.customer_loc.id,
|
|
281
|
+
"product_uom_qty": 1,
|
|
282
|
+
"product_uom": self.product.uom_id.id,
|
|
283
|
+
"name": "test",
|
|
284
|
+
"warehouse_id": self.warehouse.id,
|
|
285
|
+
"restrict_lot_id": self.lot.id,
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
move_line = self.env["stock.move.line"].create(
|
|
289
|
+
{
|
|
290
|
+
"move_id": move.id,
|
|
291
|
+
"product_id": move.product_id.id,
|
|
292
|
+
"qty_done": 1,
|
|
293
|
+
"product_uom_id": move.product_uom.id,
|
|
294
|
+
"location_id": move.location_id.id,
|
|
295
|
+
"location_dest_id": move.location_dest_id.id,
|
|
296
|
+
"lot_id": lot2.id,
|
|
297
|
+
}
|
|
298
|
+
)
|
|
299
|
+
self.assertRaises(UserError, move._action_done)
|
|
300
|
+
move_line.lot_id = self.lot
|
|
301
|
+
move._action_done()
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name: odoo-addon-
|
|
3
|
-
Version: 16.0.1.
|
|
2
|
+
Name: odoo-addon-stock_restrict_lot
|
|
3
|
+
Version: 16.0.1.2.0.2
|
|
4
4
|
Summary: Base module that add back the concept of restrict lot on stock move
|
|
5
5
|
Home-page: https://github.com/OCA/stock-logistics-workflow
|
|
6
6
|
Author: Akretion, Odoo Community Association (OCA)
|
|
7
7
|
Author-email: support@odoo-community.org
|
|
8
8
|
License: AGPL-3
|
|
9
|
-
Platform: UNKNOWN
|
|
10
9
|
Classifier: Programming Language :: Python
|
|
11
10
|
Classifier: Framework :: Odoo
|
|
12
11
|
Classifier: Framework :: Odoo :: 16.0
|
|
@@ -23,7 +22,7 @@ Stock Restrict Lot
|
|
|
23
22
|
!! This file is generated by oca-gen-addon-readme !!
|
|
24
23
|
!! changes will be overwritten. !!
|
|
25
24
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
26
|
-
!! source digest: sha256:
|
|
25
|
+
!! source digest: sha256:f43ca615da72d74e3eacdb15df13c3774cc89ee38985026febc26834c35cd556
|
|
27
26
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
28
27
|
|
|
29
28
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -77,6 +76,15 @@ Contributors
|
|
|
77
76
|
|
|
78
77
|
* Florian da Costa <florian.dacosta@akretion.com>
|
|
79
78
|
* Ruchir Shukla <ruchir@bizzappdev.com>
|
|
79
|
+
* Michael Tietz (MT Software) <mtietz@mt-software.de>
|
|
80
|
+
|
|
81
|
+
* Ooops404
|
|
82
|
+
|
|
83
|
+
* Francesco Foresti <francesco.foresti@ooops404.com>
|
|
84
|
+
|
|
85
|
+
* PyTech SRL
|
|
86
|
+
|
|
87
|
+
* Alessandro Uffreduzzi <alessandro.uffreduzzi@pytech.it>
|
|
80
88
|
|
|
81
89
|
Maintainers
|
|
82
90
|
~~~~~~~~~~~
|
|
@@ -102,5 +110,3 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|
|
102
110
|
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_restrict_lot>`_ project on GitHub.
|
|
103
111
|
|
|
104
112
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
|
105
|
-
|
|
106
|
-
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
odoo/addons/stock_restrict_lot/README.rst,sha256=pzruY795Kajmvw16dTRq8HEt6GIWMfpNXUwZmne_6LQ,3691
|
|
2
|
+
odoo/addons/stock_restrict_lot/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
|
|
3
|
+
odoo/addons/stock_restrict_lot/__manifest__.py,sha256=-9mJqgcJIBEM2BNHKqgDDfvXgljH1dNioiQUafwg2m8,506
|
|
4
|
+
odoo/addons/stock_restrict_lot/i18n/es.po,sha256=UKHL4vKheMhf0x2mZ_KwUmtjbwiCXnt-UJMeM82FwUs,2068
|
|
5
|
+
odoo/addons/stock_restrict_lot/i18n/hr.po,sha256=YTZunKeyiqSlJhW2cMSi2dQ8jzrrFXk1gDCyPvl847Y,2111
|
|
6
|
+
odoo/addons/stock_restrict_lot/i18n/it.po,sha256=p1GuTRBBNwL-2A5I00vhVf_9vekVVFpMBTOSishnong,2214
|
|
7
|
+
odoo/addons/stock_restrict_lot/i18n/stock_restrict_lot.pot,sha256=CZtSlMCRODufvFgcwFXInEZ_Msj6QHCqvB-Vap-Os1A,1729
|
|
8
|
+
odoo/addons/stock_restrict_lot/models/__init__.py,sha256=3nhRO6ipFBMbcrlWXMEMR62djB3_7q2TxcUM42xYMGg,108
|
|
9
|
+
odoo/addons/stock_restrict_lot/models/product_product.py,sha256=CzzvEF2pv0wjVHor1KAUeFYSHlk5aqf5HNR0dC3MJfY,888
|
|
10
|
+
odoo/addons/stock_restrict_lot/models/stock_move.py,sha256=l-OgWdWCfkupXK0qF5wOQ0LNhszKUKQx3QbGt8j79yE,4050
|
|
11
|
+
odoo/addons/stock_restrict_lot/models/stock_picking.py,sha256=0l60llnOb3tnmk-3pNF21kP1aR8vO0qu5BbbeqD3T6A,417
|
|
12
|
+
odoo/addons/stock_restrict_lot/models/stock_rule.py,sha256=NXXjB8rooKS0kpG3zvqpDDpLkmh7mvbnHLItDwdCec0,236
|
|
13
|
+
odoo/addons/stock_restrict_lot/readme/CONTRIBUTORS.rst,sha256=qqVPYPUv3rvLwn1l4fcebyRfQ_Y4DYx_30VCS0CFFw4,287
|
|
14
|
+
odoo/addons/stock_restrict_lot/readme/DESCRIPTION.rst,sha256=5-U3CJQ5zIpAxrXPVPXTPFmmV216MRflIecv7Ou5i4s,281
|
|
15
|
+
odoo/addons/stock_restrict_lot/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
|
16
|
+
odoo/addons/stock_restrict_lot/static/description/index.html,sha256=hQPIjhZ2jz7Ta2b49pvsLUSJ_4aQxzauu-RE7lgDQGo,13450
|
|
17
|
+
odoo/addons/stock_restrict_lot/tests/__init__.py,sha256=5RimjaqBd8kD55SNoLqh-g9sCmmI28hPx7IQMUX6AOQ,32
|
|
18
|
+
odoo/addons/stock_restrict_lot/tests/test_restrict_lot.py,sha256=6O3N_2T_90vZb4pUUY-n6Q6Ijw9DT3fbIZr2tBGtjmM,11798
|
|
19
|
+
odoo/addons/stock_restrict_lot/views/stock_move_views.xml,sha256=unNYn0AuYyBhxSnnPN6xf6X7J7S-G1KbXJVYF20scA4,1191
|
|
20
|
+
odoo/addons/stock_restrict_lot/views/stock_picking.xml,sha256=X1N9S5g09NREC_DJAlM1CjZuV21nJgBxTANn_6kC64o,1299
|
|
21
|
+
odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info/METADATA,sha256=5Vh7ahKAJYldqjAoIVFKhLn3vGyBWlx7q0ZrfShFpEc,4264
|
|
22
|
+
odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
23
|
+
odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
24
|
+
odoo_addon_stock_restrict_lot-16.0.1.2.0.2.dist-info/RECORD,,
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
odoo/addons/stock_restrict_lot/README.rst,sha256=5u5_WzyO6MBcrvMGUd8vPPAaVtA_As1Id9BZghmgtys,3494
|
|
2
|
-
odoo/addons/stock_restrict_lot/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
|
|
3
|
-
odoo/addons/stock_restrict_lot/__manifest__.py,sha256=krQUP5BLVRWxn4yqWvipsqjIBvQuXuLi8w23Uxtrfvg,506
|
|
4
|
-
odoo/addons/stock_restrict_lot/i18n/es.po,sha256=MZ60J56zGSarAYFXtDyIuji7j8P7aTmWICTuGqwKpDs,1672
|
|
5
|
-
odoo/addons/stock_restrict_lot/i18n/hr.po,sha256=Tqcd15MAg7zkAXyDo1yIi1_Kr0LXAQZWuJu0LNmo1jM,1715
|
|
6
|
-
odoo/addons/stock_restrict_lot/i18n/it.po,sha256=2c6_gI6hkHJvcpJM_6LDX2678Ks2iE15Sfj88lp8yTg,1652
|
|
7
|
-
odoo/addons/stock_restrict_lot/i18n/stock_restrict_lot.pot,sha256=y8OcQMQyb3bXNPtZPN324m37PrW_F2RO9ZPLdOBTp2Y,1333
|
|
8
|
-
odoo/addons/stock_restrict_lot/models/__init__.py,sha256=-gOtTg2qvw-MfS94T9alCWy4d-mQ09XYbPf8UeOA3MU,78
|
|
9
|
-
odoo/addons/stock_restrict_lot/models/stock_move.py,sha256=Qu2DmS70U_FLEsm6VOpN0ScoycuL2kljiMpeNitD080,2909
|
|
10
|
-
odoo/addons/stock_restrict_lot/models/stock_picking.py,sha256=0l60llnOb3tnmk-3pNF21kP1aR8vO0qu5BbbeqD3T6A,417
|
|
11
|
-
odoo/addons/stock_restrict_lot/models/stock_rule.py,sha256=NXXjB8rooKS0kpG3zvqpDDpLkmh7mvbnHLItDwdCec0,236
|
|
12
|
-
odoo/addons/stock_restrict_lot/readme/CONTRIBUTORS.rst,sha256=22s3orjbcuOva-ZDd-Tu_QSz7yv0Vf-EvMzDZZaBTeo,90
|
|
13
|
-
odoo/addons/stock_restrict_lot/readme/DESCRIPTION.rst,sha256=5-U3CJQ5zIpAxrXPVPXTPFmmV216MRflIecv7Ou5i4s,281
|
|
14
|
-
odoo/addons/stock_restrict_lot/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
|
15
|
-
odoo/addons/stock_restrict_lot/static/description/index.html,sha256=YOK0FZDI5iq9juqjgB0Xuk8hfegabzbpi7RMpX44nP8,12889
|
|
16
|
-
odoo/addons/stock_restrict_lot/tests/__init__.py,sha256=5RimjaqBd8kD55SNoLqh-g9sCmmI28hPx7IQMUX6AOQ,32
|
|
17
|
-
odoo/addons/stock_restrict_lot/tests/test_restrict_lot.py,sha256=Y36oSChijIZ9rXAldi_Lhnly75kAsaG5u5BQjlkcdw8,9048
|
|
18
|
-
odoo/addons/stock_restrict_lot/views/stock_move_views.xml,sha256=unNYn0AuYyBhxSnnPN6xf6X7J7S-G1KbXJVYF20scA4,1191
|
|
19
|
-
odoo/addons/stock_restrict_lot/views/stock_picking.xml,sha256=X1N9S5g09NREC_DJAlM1CjZuV21nJgBxTANn_6kC64o,1299
|
|
20
|
-
odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info/METADATA,sha256=DqUzX3QUtROTVNeK2AzSakO-c0lrRISyzSVhUdph-u4,4087
|
|
21
|
-
odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
22
|
-
odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
23
|
-
odoo_addon_stock_restrict_lot-16.0.1.1.0.8.dist-info/RECORD,,
|