odoo-addon-stock-move-location 16.0.1.4.1__py3-none-any.whl → 18.0.1.0.0.3__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.
Files changed (21) hide show
  1. odoo/addons/stock_move_location/README.rst +8 -7
  2. odoo/addons/stock_move_location/__manifest__.py +1 -1
  3. odoo/addons/stock_move_location/i18n/stock_move_location.pot +37 -10
  4. odoo/addons/stock_move_location/init_hook.py +1 -5
  5. odoo/addons/stock_move_location/models/stock_picking.py +9 -7
  6. odoo/addons/stock_move_location/readme/CONTRIBUTORS.md +2 -0
  7. odoo/addons/stock_move_location/readme/USAGE.md +0 -1
  8. odoo/addons/stock_move_location/static/description/index.html +6 -5
  9. odoo/addons/stock_move_location/tests/test_common.py +16 -13
  10. odoo/addons/stock_move_location/tests/test_move_location.py +19 -24
  11. odoo/addons/stock_move_location/tests/test_stock_fillwithstock.py +23 -28
  12. odoo/addons/stock_move_location/views/stock_picking.xml +1 -3
  13. odoo/addons/stock_move_location/views/stock_picking_type_views.xml +4 -7
  14. odoo/addons/stock_move_location/wizard/stock_move_location.py +46 -65
  15. odoo/addons/stock_move_location/wizard/stock_move_location.xml +60 -32
  16. odoo/addons/stock_move_location/wizard/stock_move_location_line.py +18 -30
  17. {odoo_addon_stock_move_location-16.0.1.4.1.dist-info → odoo_addon_stock_move_location-18.0.1.0.0.3.dist-info}/METADATA +13 -12
  18. {odoo_addon_stock_move_location-16.0.1.4.1.dist-info → odoo_addon_stock_move_location-18.0.1.0.0.3.dist-info}/RECORD +20 -20
  19. {odoo_addon_stock_move_location-16.0.1.4.1.dist-info → odoo_addon_stock_move_location-18.0.1.0.0.3.dist-info}/WHEEL +1 -1
  20. odoo_addon_stock_move_location-18.0.1.0.0.3.dist-info/top_level.txt +1 -0
  21. odoo_addon_stock_move_location-16.0.1.4.1.dist-info/top_level.txt +0 -1
@@ -7,7 +7,7 @@ Move Stock Location
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:9f20ba56c774915b0e3598aabcaca4a43acd2ec1c36192be9fa99be476111ebd
10
+ !! source digest: sha256:d4e4ea6fb0a6f2f34b451c22d5ab139e4f867621b65786664f6b93d57558b66d
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Move Stock Location
17
17
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
18
  :alt: License: AGPL-3
19
19
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
20
- :target: https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_move_location
20
+ :target: https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_move_location
21
21
  :alt: OCA/stock-logistics-warehouse
22
22
  .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23
- :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-stock_move_location
23
+ :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-18-0/stock-logistics-warehouse-18-0-stock_move_location
24
24
  :alt: Translate me on Weblate
25
25
  .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26
- :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=16.0
26
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=18.0
27
27
  :alt: Try me on Runboat
28
28
 
29
29
  |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -43,7 +43,6 @@ Usage
43
43
  where 2 locations can be specified.
44
44
  - Select origin and destination locations and press "IMMEDIATE TRANSFER"
45
45
  or "PLANNED TRANSFER"
46
- - Press ADD ALL button to add all products available
47
46
  - Those lines can be edited. Move quantity can't be more than a max
48
47
  available quantity
49
48
  - Move doesn't care about the reservations and will move stuff anyway
@@ -106,7 +105,7 @@ Bug Tracker
106
105
  Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
107
106
  In case of trouble, please check there if your issue has already been reported.
108
107
  If you spotted it first, help us to smash it by providing a detailed and welcomed
109
- `feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_move_location%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
108
+ `feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_move_location%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
110
109
 
111
110
  Do not contact contributors directly about support or help with technical issues.
112
111
 
@@ -133,6 +132,7 @@ Contributors
133
132
 
134
133
  - Sergio Teruel
135
134
  - João Marques
135
+ - Carlos Roca
136
136
 
137
137
  - Jacques-Etienne Baudoux <je@bcim.be>
138
138
  - Iryna Vyshnevska <i.vyshnevska@mobilunity.com>
@@ -143,6 +143,7 @@ Contributors
143
143
  - Aung Ko Ko Lin
144
144
 
145
145
  - Laurent Mignon <laurent.mignon@acsone.eu>
146
+ - Maksym Yankin <maksym.yankin@camptocamp.com>
146
147
 
147
148
  Maintainers
148
149
  -----------
@@ -157,6 +158,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
157
158
  mission is to support the collaborative development of Odoo features and
158
159
  promote its widespread use.
159
160
 
160
- This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_move_location>`_ project on GitHub.
161
+ This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_move_location>`_ project on GitHub.
161
162
 
162
163
  You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
@@ -5,7 +5,7 @@
5
5
 
6
6
  {
7
7
  "name": "Move Stock Location",
8
- "version": "16.0.1.4.1",
8
+ "version": "18.0.1.0.0",
9
9
  "author": "Julius Network Solutions, "
10
10
  "BCIM,"
11
11
  "Camptocamp,"
@@ -4,7 +4,7 @@
4
4
  #
5
5
  msgid ""
6
6
  msgstr ""
7
- "Project-Id-Version: Odoo Server 16.0\n"
7
+ "Project-Id-Version: Odoo Server 18.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "Last-Translator: \n"
10
10
  "Language-Team: \n"
@@ -28,6 +28,11 @@ msgstr ""
28
28
  msgid "Cancel"
29
29
  msgstr ""
30
30
 
31
+ #. module: stock_move_location
32
+ #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__company_id
33
+ msgid "Company"
34
+ msgstr ""
35
+
31
36
  #. module: stock_move_location
32
37
  #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__picking_id
33
38
  msgid "Connected Picking"
@@ -69,9 +74,20 @@ msgstr ""
69
74
 
70
75
  #. module: stock_move_location
71
76
  #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__edit_locations
77
+ #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
72
78
  msgid "Edit Locations"
73
79
  msgstr ""
74
80
 
81
+ #. module: stock_move_location
82
+ #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__exclude_reserved_qty
83
+ msgid "Exclude Reserved Qty"
84
+ msgstr ""
85
+
86
+ #. module: stock_move_location
87
+ #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
88
+ msgid "Exclude Reserved Quantities"
89
+ msgstr ""
90
+
75
91
  #. module: stock_move_location
76
92
  #: model_terms:ir.ui.view,arch_db:stock_move_location.view_picking_form
77
93
  msgid "Fill with stock"
@@ -93,12 +109,6 @@ msgstr ""
93
109
  msgid "Immediate Transfer"
94
110
  msgstr ""
95
111
 
96
- #. module: stock_move_location
97
- #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location____last_update
98
- #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line____last_update
99
- msgid "Last Modified on"
100
- msgstr ""
101
-
102
112
  #. module: stock_move_location
103
113
  #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location__write_uid
104
114
  #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__write_uid
@@ -111,6 +121,11 @@ msgstr ""
111
121
  msgid "Last Updated on"
112
122
  msgstr ""
113
123
 
124
+ #. module: stock_move_location
125
+ #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
126
+ msgid "Lot/SN:"
127
+ msgstr ""
128
+
114
129
  #. module: stock_move_location
115
130
  #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__lot_id
116
131
  msgid "Lot/Serial Number"
@@ -145,7 +160,6 @@ msgstr ""
145
160
  #. module: stock_move_location
146
161
  #. odoo-python
147
162
  #: code:addons/stock_move_location/wizard/stock_move_location_line.py:0
148
- #, python-format
149
163
  msgid "Move quantity can not exceed max quantity or be negative"
150
164
  msgstr ""
151
165
 
@@ -157,7 +171,6 @@ msgstr ""
157
171
  #. module: stock_move_location
158
172
  #. odoo-python
159
173
  #: code:addons/stock_move_location/models/stock_picking.py:0
160
- #, python-format
161
174
  msgid "Moves lines already exists"
162
175
  msgstr ""
163
176
 
@@ -196,7 +209,6 @@ msgstr ""
196
209
  #. module: stock_move_location
197
210
  #. odoo-python
198
211
  #: code:addons/stock_move_location/models/stock_picking.py:0
199
- #, python-format
200
212
  msgid "Please choose a source end location"
201
213
  msgstr ""
202
214
 
@@ -210,6 +222,11 @@ msgstr ""
210
222
  msgid "Product Unit of Measure"
211
223
  msgstr ""
212
224
 
225
+ #. module: stock_move_location
226
+ #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
227
+ msgid "Quantity"
228
+ msgstr ""
229
+
213
230
  #. module: stock_move_location
214
231
  #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__move_quantity
215
232
  msgid "Quantity to move"
@@ -237,11 +254,21 @@ msgstr ""
237
254
  msgid "Stock Move"
238
255
  msgstr ""
239
256
 
257
+ #. module: stock_move_location
258
+ #: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line__total_quantity
259
+ msgid "Total existence quantity"
260
+ msgstr ""
261
+
240
262
  #. module: stock_move_location
241
263
  #: model:ir.model,name:stock_move_location.model_stock_picking
242
264
  msgid "Transfer"
243
265
  msgstr ""
244
266
 
267
+ #. module: stock_move_location
268
+ #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
269
+ msgid "Unit of Measure"
270
+ msgstr ""
271
+
245
272
  #. module: stock_move_location
246
273
  #: model_terms:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
247
274
  msgid "UoM"
@@ -1,9 +1,5 @@
1
1
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2
- from odoo import SUPERUSER_ID, api
3
-
4
-
5
- def enable_multi_locations(cr, registry):
6
- env = api.Environment(cr, SUPERUSER_ID, {})
2
+ def enable_multi_locations(env):
7
3
  ResConfig = env["res.config.settings"]
8
4
  default_values = ResConfig.default_get(list(ResConfig.fields_get()))
9
5
  default_values.update({"group_stock_multi_locations": True})
@@ -17,7 +17,6 @@ class StockPicking(models.Model):
17
17
  context = {
18
18
  "active_ids": self._get_movable_quants().ids,
19
19
  "active_model": "stock.quant",
20
- "only_reserved_qty": True,
21
20
  "planned": True,
22
21
  }
23
22
  move_wizard = (
@@ -32,7 +31,6 @@ class StockPicking(models.Model):
32
31
  }
33
32
  )
34
33
  )
35
- move_wizard._onchange_destination_location_id()
36
34
  move_wizard.action_move_location()
37
35
  return True
38
36
 
@@ -43,9 +41,13 @@ class StockPicking(models.Model):
43
41
  raise UserError(_("Moves lines already exists"))
44
42
 
45
43
  def _get_movable_quants(self):
46
- return self.env["stock.quant"].search(
47
- [
48
- ("location_id", "=", self.location_id.id),
49
- ("quantity", ">", 0.0),
50
- ]
44
+ return (
45
+ self.env["stock.quant"]
46
+ .search(
47
+ [
48
+ ("location_id", "=", self.location_id.id),
49
+ ("quantity", ">", 0.0),
50
+ ]
51
+ )
52
+ .filtered(lambda quant: quant.quantity - quant.reserved_quantity > 0.0)
51
53
  )
@@ -7,6 +7,7 @@
7
7
  - Tecnativa \<tecnativa.com\>
8
8
  - Sergio Teruel
9
9
  - João Marques
10
+ - Carlos Roca
10
11
  - Jacques-Etienne Baudoux \<<je@bcim.be>\>
11
12
  - Iryna Vyshnevska \<<i.vyshnevska@mobilunity.com>\>
12
13
  - Alexei Rivera \<<arivera@archeti.com>\>
@@ -14,3 +15,4 @@
14
15
  - Quartile \<<https://www.quartile.co>\>
15
16
  - Aung Ko Ko Lin
16
17
  - Laurent Mignon \<<laurent.mignon@acsone.eu>\>
18
+ - Maksym Yankin \<<maksym.yankin@camptocamp.com>\>
@@ -2,7 +2,6 @@
2
2
  can be specified.
3
3
  - Select origin and destination locations and press "IMMEDIATE TRANSFER" or "PLANNED
4
4
  TRANSFER"
5
- - Press ADD ALL button to add all products available
6
5
  - Those lines can be edited. Move quantity can't be more than a max available quantity
7
6
  - Move doesn't care about the reservations and will move stuff anyway
8
7
  - If during your operation with the wizard the real quantity will change it will move
@@ -367,9 +367,9 @@ 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:9f20ba56c774915b0e3598aabcaca4a43acd2ec1c36192be9fa99be476111ebd
370
+ !! source digest: sha256:d4e4ea6fb0a6f2f34b451c22d5ab139e4f867621b65786664f6b93d57558b66d
371
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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-warehouse/tree/16.0/stock_move_location"><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_move_location"><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>
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-warehouse/tree/18.0/stock_move_location"><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_move_location"><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>
373
373
  <p>This module allows to move entire location of products from one place to
374
374
  another and move only selected quantities.</p>
375
375
  <p><strong>Table of contents</strong></p>
@@ -393,7 +393,6 @@ another and move only selected quantities.</p>
393
393
  where 2 locations can be specified.</li>
394
394
  <li>Select origin and destination locations and press “IMMEDIATE TRANSFER”
395
395
  or “PLANNED TRANSFER”</li>
396
- <li>Press ADD ALL button to add all products available</li>
397
396
  <li>Those lines can be edited. Move quantity can’t be more than a max
398
397
  available quantity</li>
399
398
  <li>Move doesn’t care about the reservations and will move stuff anyway</li>
@@ -447,7 +446,7 @@ filled in.</li>
447
446
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
448
447
  In case of trouble, please check there if your issue has already been reported.
449
448
  If you spotted it first, help us to smash it by providing a detailed and welcomed
450
- <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_move_location%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
449
+ <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_move_location%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
451
450
  <p>Do not contact contributors directly about support or help with technical issues.</p>
452
451
  </div>
453
452
  <div class="section" id="credits">
@@ -472,6 +471,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
472
471
  <li>Tecnativa &lt;tecnativa.com&gt;<ul>
473
472
  <li>Sergio Teruel</li>
474
473
  <li>João Marques</li>
474
+ <li>Carlos Roca</li>
475
475
  </ul>
476
476
  </li>
477
477
  <li>Jacques-Etienne Baudoux &lt;<a class="reference external" href="mailto:je&#64;bcim.be">je&#64;bcim.be</a>&gt;</li>
@@ -483,6 +483,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
483
483
  </ul>
484
484
  </li>
485
485
  <li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
486
+ <li>Maksym Yankin &lt;<a class="reference external" href="mailto:maksym.yankin&#64;camptocamp.com">maksym.yankin&#64;camptocamp.com</a>&gt;</li>
486
487
  </ul>
487
488
  </div>
488
489
  <div class="section" id="maintainers">
@@ -494,7 +495,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
494
495
  <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
495
496
  mission is to support the collaborative development of Odoo features and
496
497
  promote its widespread use.</p>
497
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/16.0/stock_move_location">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
498
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_move_location">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
498
499
  <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>
499
500
  </div>
500
501
  </div>
@@ -1,17 +1,17 @@
1
1
  # Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
2
2
  # Copyright 2018 Camptocamp SA
3
3
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
4
+ from odoo.tests import Form
4
5
 
5
- from odoo.tests import Form, common
6
+ from odoo.addons.base.tests.common import BaseCommon
6
7
 
7
8
 
8
- class TestsCommon(common.TransactionCase):
9
+ class TestsCommon(BaseCommon):
9
10
  @classmethod
10
11
  def setUpClass(cls):
11
12
  super().setUpClass()
12
- cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
13
13
  cls.location_obj = cls.env["stock.location"]
14
- product_obj = cls.env["product.product"]
14
+ cls.product_obj = cls.env["product.product"]
15
15
  cls.wizard_obj = cls.env["wiz.stock.move.location"]
16
16
  cls.quant_obj = cls.env["stock.quant"]
17
17
  cls.company = cls.env.ref("base.main_company")
@@ -43,14 +43,14 @@ class TestsCommon(common.TransactionCase):
43
43
  }
44
44
  )
45
45
  cls.uom_unit = cls.env.ref("uom.product_uom_unit")
46
- cls.product_no_lots = product_obj.create(
47
- {"name": "Pineapple", "type": "product", "tracking": "none"}
46
+ cls.product_no_lots = cls.product_obj.create(
47
+ {"name": "Pineapple", "is_storable": True, "tracking": "none"}
48
48
  )
49
- cls.product_lots = product_obj.create(
50
- {"name": "Apple", "type": "product", "tracking": "lot"}
49
+ cls.product_lots = cls.product_obj.create(
50
+ {"name": "Apple", "is_storable": True, "tracking": "lot"}
51
51
  )
52
- cls.product_package = product_obj.create(
53
- {"name": "Orange", "type": "product", "tracking": "lot"}
52
+ cls.product_package = cls.product_obj.create(
53
+ {"name": "Orange", "is_storable": True, "tracking": "lot"}
54
54
  )
55
55
  cls.lot1 = cls.env["stock.lot"].create(
56
56
  {
@@ -73,8 +73,8 @@ class TestsCommon(common.TransactionCase):
73
73
  "company_id": cls.company.id,
74
74
  }
75
75
  )
76
- cls.product_package = product_obj.create(
77
- {"name": "Orange", "type": "product", "tracking": "lot"}
76
+ cls.product_package = cls.product_obj.create(
77
+ {"name": "Orange", "is_storable": True, "tracking": "lot"}
78
78
  )
79
79
  cls.lot4 = cls.env["stock.lot"].create(
80
80
  {
@@ -157,12 +157,15 @@ class TestsCommon(common.TransactionCase):
157
157
  amount,
158
158
  )
159
159
 
160
- def _create_wizard(self, origin_location, destination_location):
160
+ def _create_wizard(
161
+ self, origin_location, destination_location, exclude_reserved_qty=False
162
+ ):
161
163
  move_location_wizard = self.env["wiz.stock.move.location"]
162
164
  return move_location_wizard.create(
163
165
  {
164
166
  "origin_location_id": origin_location.id,
165
167
  "destination_location_id": destination_location.id,
168
+ "exclude_reserved_qty": exclude_reserved_qty,
166
169
  }
167
170
  )
168
171
 
@@ -84,20 +84,18 @@ class TestMoveLocation(TestsCommon):
84
84
  wizard = self._create_wizard(self.internal_loc_1, self.internal_loc_2)
85
85
  wizard.onchange_origin_location()
86
86
  self.assertEqual(len(wizard.stock_move_location_line_ids), 7)
87
- wizard._onchange_destination_location_id()
88
- self.assertEqual(len(wizard.stock_move_location_line_ids), 7)
89
87
  dest_location_line = wizard.stock_move_location_line_ids.mapped(
90
88
  "destination_location_id"
91
89
  )
92
90
  self.assertEqual(dest_location_line, wizard.destination_location_id)
93
- wizard._onchange_origin_location_id()
91
+ wizard.clear_lines()
94
92
  self.assertEqual(len(wizard.stock_move_location_line_ids), 0)
95
93
 
96
94
  def test_wizard_onchange_origin_location(self):
97
95
  """Test a product that have existing quants with undefined quantity."""
98
96
 
99
97
  product_not_available = self.env["product.product"].create(
100
- {"name": "Mango", "type": "product", "tracking": "none"}
98
+ {"name": "Mango", "is_storable": True, "tracking": "none"}
101
99
  )
102
100
  self.quant_obj.create(
103
101
  {
@@ -137,7 +135,7 @@ class TestMoveLocation(TestsCommon):
137
135
  )
138
136
  picking_lines = sorted(
139
137
  [
140
- (line.product_id.id, line.lot_id.id, line.reserved_uom_qty)
138
+ (line.product_id.id, line.lot_id.id, line.quantity)
141
139
  for line in picking.move_line_ids
142
140
  ],
143
141
  key=lambda x: (x[0], x[1]),
@@ -148,13 +146,13 @@ class TestMoveLocation(TestsCommon):
148
146
  "Mismatch between move location lines and move lines",
149
147
  )
150
148
  self.assertEqual(
151
- sorted(picking.move_line_ids.mapped("reserved_uom_qty")),
149
+ sorted(picking.move_line_ids.mapped("quantity")),
152
150
  [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 123.0],
153
151
  )
154
152
 
155
153
  def test_planned_transfer_strict(self):
156
154
  product = self.env["product.product"].create(
157
- {"name": "Test", "type": "product", "tracking": "lot"}
155
+ {"name": "Test", "is_storable": True, "tracking": "lot"}
158
156
  )
159
157
  lot = self.env["stock.lot"].create(
160
158
  {
@@ -193,14 +191,14 @@ class TestMoveLocation(TestsCommon):
193
191
  location_line.move_quantity,
194
192
  ]
195
193
  line = picking.move_line_ids
196
- picking_lines = [line.product_id.id, line.lot_id.id, line.reserved_uom_qty]
194
+ picking_lines = [line.product_id.id, line.lot_id.id, line.quantity]
197
195
  self.assertEqual(
198
196
  wizard_lines,
199
197
  picking_lines,
200
198
  "Mismatch between move location lines and move lines",
201
199
  )
202
200
  self.assertEqual(
203
- picking.move_line_ids.reserved_uom_qty,
201
+ picking.move_line_ids.quantity,
204
202
  10.0,
205
203
  )
206
204
 
@@ -214,14 +212,10 @@ class TestMoveLocation(TestsCommon):
214
212
  location_lines.unlink()
215
213
  wizard.action_move_location()
216
214
  picking = wizard.picking_id
217
- self.assertEqual(picking.state, "assigned")
218
- self.assertEqual(
219
- len(wizard.stock_move_location_line_ids), len(picking.move_line_ids)
220
- )
221
- self.assertEqual(
222
- picking.move_line_ids.mapped("reserved_uom_qty"),
223
- [0.0],
224
- )
215
+ # Planned transfer state is "confirmed"
216
+ # move lines (quantity is zero) are removed
217
+ self.assertEqual(picking.state, "confirmed")
218
+ self.assertFalse(picking.move_line_ids)
225
219
 
226
220
  def test_quant_transfer(self):
227
221
  """Test quants transfer."""
@@ -241,10 +235,8 @@ class TestMoveLocation(TestsCommon):
241
235
  wizard.onchange_origin_location()
242
236
  self.assertEqual(len(lines), 3)
243
237
  wizard.destination_location_id = self.internal_loc_1
244
- wizard._onchange_destination_location_id()
245
238
  self.assertEqual(lines.mapped("destination_location_id"), self.internal_loc_1)
246
239
  wizard.origin_location_id = self.internal_loc_2
247
- wizard._onchange_destination_location_id()
248
240
  self.assertEqual(len(lines), 3)
249
241
 
250
242
  def test_readonly_location_computation(self):
@@ -276,7 +268,7 @@ class TestMoveLocation(TestsCommon):
276
268
  lambda p: p.product_id == self.product_no_lots
277
269
  )[0]
278
270
  self.assertEqual(
279
- putaway_line.destination_location_id, self.internal_loc_2_shelf
271
+ putaway_line.destination_location_id, wizard.destination_location_id
280
272
  )
281
273
  picking_action = wizard.action_move_location()
282
274
  picking = self.env["stock.picking"].browse(picking_action["res_id"])
@@ -302,6 +294,7 @@ class TestMoveLocation(TestsCommon):
302
294
 
303
295
  # Create and assign a delivery picking to reserve some quantities
304
296
  delivery_picking = self._create_picking(delivery_order_type)
297
+ # delivery_picking.location_id = wh_stock_shelf_1
305
298
  delivery_move = self.env["stock.move"].create(
306
299
  {
307
300
  "name": "Delivery move",
@@ -315,12 +308,14 @@ class TestMoveLocation(TestsCommon):
315
308
  )
316
309
  delivery_picking.action_confirm()
317
310
  self.assertEqual(delivery_picking.state, "assigned")
311
+ self.assertEqual(delivery_move.move_line_ids.location_id, wh_stock_shelf_1)
318
312
 
319
313
  # Move all quantities to other location using module's wizard
320
314
  wizard = self._create_wizard(wh_stock_shelf_1, wh_stock_shelf_2)
321
315
  wizard.onchange_origin_location()
322
316
  wizard.action_move_location()
323
- self.assertEqual(delivery_picking.state, "confirmed")
317
+ self.assertEqual(delivery_picking.state, "assigned")
318
+ self.assertEqual(delivery_move.move_line_ids.location_id, wh_stock_shelf_2)
324
319
 
325
320
  # Do a planned transfer to move quantities to other location
326
321
  # without using module's wizard
@@ -344,8 +339,8 @@ class TestMoveLocation(TestsCommon):
344
339
  self.assertEqual(delivery_picking.state, "confirmed")
345
340
  internal_picking.action_confirm()
346
341
  internal_picking.action_assign()
347
- internal_picking.move_line_ids.qty_done = (
348
- internal_picking.move_line_ids.reserved_uom_qty
342
+ internal_picking.move_line_ids.quantity = (
343
+ internal_picking.move_line_ids.quantity
349
344
  )
350
345
  internal_picking.button_validate()
351
346
  self.assertEqual(internal_picking.state, "done")
@@ -354,5 +349,5 @@ class TestMoveLocation(TestsCommon):
354
349
  self.assertEqual(delivery_picking.state, "assigned")
355
350
  # The old reserved quantities must be in new location after confirm wizard
356
351
  self.assertEqual(len(delivery_move.move_line_ids), 1)
357
- self.assertEqual(delivery_move.move_line_ids.reserved_uom_qty, 20.0)
352
+ self.assertEqual(delivery_move.move_line_ids.quantity, 20.0)
358
353
  self.assertEqual(delivery_move.move_line_ids.location_id, wh_stock_shelf_3)
@@ -2,63 +2,58 @@
2
2
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3
3
 
4
4
 
5
- import odoo.tests.common as common
5
+ from odoo.addons.base.tests.common import BaseCommon
6
6
 
7
7
 
8
- class TestFillwithStock(common.TransactionCase):
9
- def setUp(self):
10
- super(TestFillwithStock, self).setUp()
11
- self.env = self.env(
12
- context=dict(
13
- self.env.context,
14
- tracking_disable=True,
15
- )
16
- )
8
+ class TestFillwithStock(BaseCommon):
9
+ @classmethod
10
+ def setUpClass(cls):
11
+ super().setUpClass()
17
12
 
18
- self.stock_location = self.env.ref("stock.stock_location_stock")
19
- self.pack_location = self.env.ref("stock.location_pack_zone")
13
+ cls.stock_location = cls.env.ref("stock.stock_location_stock")
14
+ cls.pack_location = cls.env.ref("stock.location_pack_zone")
20
15
 
21
- self.shelf1_location = self.env["stock.location"].create(
16
+ cls.shelf1_location = cls.env["stock.location"].create(
22
17
  {
23
18
  "name": "Test location",
24
19
  "usage": "internal",
25
- "location_id": self.stock_location.id,
20
+ "location_id": cls.stock_location.id,
26
21
  }
27
22
  )
28
23
 
29
- self.product1 = self.env["product.product"].create(
24
+ cls.product1 = cls.env["product.product"].create(
30
25
  {
31
26
  "name": "Product A",
32
- "type": "product",
27
+ "is_storable": True,
33
28
  }
34
29
  )
35
- self.product2 = self.env["product.product"].create(
30
+ cls.product2 = cls.env["product.product"].create(
36
31
  {
37
32
  "name": "Product B",
38
- "type": "product",
33
+ "is_storable": True,
39
34
  }
40
35
  )
41
36
 
42
- self.env["stock.quant"].create(
37
+ cls.env["stock.quant"].create(
43
38
  {
44
- "product_id": self.product1.id,
45
- "location_id": self.shelf1_location.id,
39
+ "product_id": cls.product1.id,
40
+ "location_id": cls.shelf1_location.id,
46
41
  "quantity": 5.0,
47
42
  "reserved_quantity": 0.0,
48
43
  }
49
44
  )
50
- self.env["stock.quant"].create(
45
+ cls.env["stock.quant"].create(
51
46
  {
52
- "product_id": self.product1.id,
53
- "location_id": self.shelf1_location.id,
47
+ "product_id": cls.product1.id,
48
+ "location_id": cls.shelf1_location.id,
54
49
  "quantity": 10.0,
55
50
  "reserved_quantity": 5.0,
56
51
  }
57
52
  )
58
- self.env["stock.quant"].create(
53
+ cls.env["stock.quant"].create(
59
54
  {
60
- "product_id": self.product2.id,
61
- "location_id": self.shelf1_location.id,
55
+ "product_id": cls.product2.id,
56
+ "location_id": cls.shelf1_location.id,
62
57
  "quantity": 5.0,
63
58
  "reserved_quantity": 0.0,
64
59
  }
@@ -80,7 +75,7 @@ class TestFillwithStock(common.TransactionCase):
80
75
  picking_stock_pack.move_ids.filtered(
81
76
  lambda m: m.product_id == self.product1
82
77
  ).product_uom_qty,
83
- 10.0,
78
+ 15.0,
84
79
  )
85
80
  self.assertEqual(
86
81
  picking_stock_pack.move_ids.filtered(
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" ?>
2
2
  <odoo>
3
-
4
3
  <record id="view_picking_form" model="ir.ui.view">
5
4
  <field name="name">stock.picking.form.fillwithstock</field>
6
5
  <field name="model">stock.picking</field>
@@ -9,7 +8,7 @@
9
8
  <button name="action_confirm" position="before">
10
9
  <button
11
10
  name="button_fillwithstock"
12
- states="draft"
11
+ invisible="state != 'draft'"
13
12
  string="Fill with stock"
14
13
  type="object"
15
14
  class="oe_highlight"
@@ -18,5 +17,4 @@
18
17
  </button>
19
18
  </field>
20
19
  </record>
21
-
22
20
  </odoo>