Skip to content

Commit f9ef9a1

Browse files
committed
[MIG] stock_move_location: Migration to 19.0
1 parent 76b9a2c commit f9ef9a1

File tree

10 files changed

+120
-126
lines changed

10 files changed

+120
-126
lines changed

stock_move_location/README.rst

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ Move Stock Location
2121
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
2222
:alt: License: AGPL-3
2323
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
24-
:target: https://github.com/OCA/stock-logistics-warehouse/tree/18.0/stock_move_location
24+
:target: https://github.com/OCA/stock-logistics-warehouse/tree/19.0/stock_move_location
2525
:alt: OCA/stock-logistics-warehouse
2626
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
27-
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-18-0/stock-logistics-warehouse-18-0-stock_move_location
27+
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-19-0/stock-logistics-warehouse-19-0-stock_move_location
2828
:alt: Translate me on Weblate
2929
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
30-
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=18.0
30+
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=19.0
3131
:alt: Try me on Runboat
3232

3333
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -43,25 +43,26 @@ another and move only selected quantities.
4343
Usage
4444
=====
4545

46-
- A new menu item Operations > Move from location... opens a wizard
47-
where 2 locations can be specified.
48-
- Select origin and destination locations and press "IMMEDIATE TRANSFER"
49-
or "PLANNED TRANSFER"
50-
- Those lines can be edited. Move quantity can't be more than a max
51-
available quantity
52-
- Move doesn't care about the reservations and will move stuff anyway
53-
- If during your operation with the wizard the real quantity will change
54-
it will move only the available quantity at the button press
55-
- Products will be moved and a form view of picking that did that will
56-
show up
57-
- If "PLANNED TRANSFER" is used - the picking won't be validated
58-
automatically
46+
- A new menu item Operations > Move from location... opens a wizard
47+
where 2 locations can be specified.
48+
- Select origin and destination locations and press "IMMEDIATE
49+
TRANSFER" or "PLANNED TRANSFER"
50+
- Those lines can be edited. Move quantity can't be more than a max
51+
available quantity
52+
- Move doesn't care about the reservations and will move stuff anyway
53+
- If during your operation with the wizard the real quantity will
54+
change it will move only the available quantity at the button press
55+
- Products will be moved and a form view of picking that did that will
56+
show up
57+
- If "PLANNED TRANSFER" is used - the picking won't be validated
58+
automatically
5959

6060
If you want to transfer a full quant:
6161

62-
- Go to Inventory > Products > Products and click "On hand" smart button
63-
or Inventory > Reporting > Inventory, the quants view will be opened.
64-
- Select the quantities which you want move to another location
62+
- Go to Inventory > Products > Products and click "On hand" smart
63+
button or Inventory > Reporting > Inventory, the quants view will be
64+
opened.
65+
- Select the quantities which you want move to another location
6566

6667
If you go to the Inventory Dashboard you can see the button "Move from
6768
location" in each of the picking types (only applicable to internal and
@@ -94,28 +95,29 @@ Known issues / Roadmap
9495
Change the current implementation (suggested by Denis Roussel from
9596
ACSONE):
9697

97-
- A new parameter on stock picking types : 'Product Change Location'
98-
(with a little help).
99-
- With this, go to the dashboard, create a picking with that type.
100-
- Add a button on the picking form which is visible with that type that
101-
fill in the picking as now
102-
- Nice to have: add a magic button on locations that with context
103-
creates a new picking of that type with the origin location already
104-
filled in.
98+
- A new parameter on stock picking types : 'Product Change Location'
99+
(with a little help).
100+
- With this, go to the dashboard, create a picking with that type.
101+
- Add a button on the picking form which is visible with that type that
102+
fill in the picking as now
103+
- Nice to have: add a magic button on locations that with context
104+
creates a new picking of that type with the origin location already
105+
filled in.
105106

106107
Note from Jacques-Etienne Baudoux (BCIM)
107108

108-
- The fill with stock action on stock.picking should not create manually
109-
the move lines but instead call ``action_assign()``. There are many
110-
modules hooking ``action_assign`` that are not called due to this.
109+
- The fill with stock action on stock.picking should not create
110+
manually the move lines but instead call ``action_assign()``. There
111+
are many modules hooking ``action_assign`` that are not called due to
112+
this.
111113

112114
Bug Tracker
113115
===========
114116

115117
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
116118
In case of trouble, please check there if your issue has already been reported.
117119
If you spotted it first, help us to smash it by providing a detailed and welcomed
118-
`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**>`_.
120+
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_move_location%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
119121

120122
Do not contact contributors directly about support or help with technical issues.
121123

@@ -132,28 +134,31 @@ Authors
132134
Contributors
133135
------------
134136

135-
- Mathieu Vatel <mathieu@julius.fr>
136-
- Mykhailo Panarin <m.panarin@mobilunity.com>
137-
- Joan Sisquella <joan.sisquella@forgeflow.com>
138-
- Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
139-
- Lois Rilo <lois.rilo@forgeflow.com>
140-
- Héctor Villarreal <hector.villarreal@forgeflow.com>
141-
- Tecnativa <tecnativa.com>
137+
- Mathieu Vatel <mathieu@julius.fr>
138+
- Mykhailo Panarin <m.panarin@mobilunity.com>
139+
- Joan Sisquella <joan.sisquella@forgeflow.com>
140+
- Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
141+
- Lois Rilo <lois.rilo@forgeflow.com>
142+
- Héctor Villarreal <hector.villarreal@forgeflow.com>
143+
- Tecnativa <tecnativa.com>
142144

143-
- Sergio Teruel
144-
- João Marques
145-
- Carlos Roca
145+
- Sergio Teruel
146+
- João Marques
147+
- Carlos Roca
146148

147-
- Jacques-Etienne Baudoux <je@bcim.be>
148-
- Iryna Vyshnevska <i.vyshnevska@mobilunity.com>
149-
- Alexei Rivera <arivera@archeti.com>
150-
- Abraham Anes <abraham@studio73.es>
151-
- Quartile <https://www.quartile.co>
149+
- Jacques-Etienne Baudoux <je@bcim.be>
150+
- Iryna Vyshnevska <i.vyshnevska@mobilunity.com>
151+
- Alexei Rivera <arivera@archeti.com>
152+
- Abraham Anes <abraham@studio73.es>
153+
- Quartile <https://www.quartile.co>
152154

153-
- Aung Ko Ko Lin
155+
- Aung Ko Ko Lin
154156

155-
- Laurent Mignon <laurent.mignon@acsone.eu>
156-
- Maksym Yankin <maksym.yankin@camptocamp.com>
157+
- Laurent Mignon <laurent.mignon@acsone.eu>
158+
- Maksym Yankin <maksym.yankin@camptocamp.com>
159+
- Open Source Integrators <https://www.opensourceintegrators.com>
160+
161+
- Daniel Reis <dreis@opensourceintegrators.com>
157162

158163
Maintainers
159164
-----------
@@ -168,6 +173,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
168173
mission is to support the collaborative development of Odoo features and
169174
promote its widespread use.
170175

171-
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.
176+
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/19.0/stock_move_location>`_ project on GitHub.
172177

173178
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

stock_move_location/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
{
77
"name": "Move Stock Location",
8-
"version": "18.0.1.0.1",
8+
"version": "19.0.1.0.0",
99
"author": "Julius Network Solutions, "
1010
"BCIM,"
1111
"Camptocamp,"

stock_move_location/data/stock_quant_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<field name="view_mode">form</field>
99
<field name="context" eval="{'origin_location_disable': True}" />
1010
<field name="target">new</field>
11-
<field name="groups_id" eval="[(4, ref('stock.group_stock_user'))]" />
11+
<field name="group_ids" eval="[(4, ref('stock.group_stock_user'))]" />
1212
</record>
1313
</odoo>

stock_move_location/models/stock_picking.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright Iryna Vyshnevska 2020 Camptocamp
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
44

5-
from odoo import _, models
5+
from odoo import models
66
from odoo.exceptions import UserError
77

88

@@ -38,9 +38,9 @@ def button_fillwithstock(self):
3838

3939
def _validate_picking(self):
4040
if self.location_id.child_ids:
41-
raise UserError(_("Please choose a source end location"))
41+
raise UserError(self.env._("Please choose a source end location"))
4242
if self.move_ids:
43-
raise UserError(_("Moves lines already exists"))
43+
raise UserError(self.env._("Moves lines already exists"))
4444

4545
def _get_movable_quants(self):
4646
return (

stock_move_location/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
- Aung Ko Ko Lin
1717
- Laurent Mignon \<<laurent.mignon@acsone.eu>\>
1818
- Maksym Yankin \<<maksym.yankin@camptocamp.com>\>
19+
- Open Source Integrators \<<https://www.opensourceintegrators.com>\>
20+
- Daniel Reis <<dreis@opensourceintegrators.com>>

stock_move_location/static/description/index.html

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h1>Move Stock Location</h1>
374374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375375
!! source digest: sha256:792445e5024062bee785b19642189b2500b863643ed32db16d168d433c7dc7fd
376376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<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/license-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>
377+
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-warehouse/tree/19.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-19-0/stock-logistics-warehouse-19-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=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378378
<p>This module allows to move entire location of products from one place to
379379
another and move only selected quantities.</p>
380380
<p><strong>Table of contents</strong></p>
@@ -396,22 +396,23 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
396396
<ul class="simple">
397397
<li>A new menu item Operations &gt; Move from location… opens a wizard
398398
where 2 locations can be specified.</li>
399-
<li>Select origin and destination locations and press “IMMEDIATE TRANSFER”
400-
or “PLANNED TRANSFER”</li>
399+
<li>Select origin and destination locations and press “IMMEDIATE
400+
TRANSFER” or “PLANNED TRANSFER”</li>
401401
<li>Those lines can be edited. Move quantity can’t be more than a max
402402
available quantity</li>
403403
<li>Move doesn’t care about the reservations and will move stuff anyway</li>
404-
<li>If during your operation with the wizard the real quantity will change
405-
it will move only the available quantity at the button press</li>
404+
<li>If during your operation with the wizard the real quantity will
405+
change it will move only the available quantity at the button press</li>
406406
<li>Products will be moved and a form view of picking that did that will
407407
show up</li>
408408
<li>If “PLANNED TRANSFER” is used - the picking won’t be validated
409409
automatically</li>
410410
</ul>
411411
<p>If you want to transfer a full quant:</p>
412412
<ul class="simple">
413-
<li>Go to Inventory &gt; Products &gt; Products and click “On hand” smart button
414-
or Inventory &gt; Reporting &gt; Inventory, the quants view will be opened.</li>
413+
<li>Go to Inventory &gt; Products &gt; Products and click “On hand” smart
414+
button or Inventory &gt; Reporting &gt; Inventory, the quants view will be
415+
opened.</li>
415416
<li>Select the quantities which you want move to another location</li>
416417
</ul>
417418
<p>If you go to the Inventory Dashboard you can see the button “Move from
@@ -447,17 +448,18 @@ <h2><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h2>
447448
</ul>
448449
<p>Note from Jacques-Etienne Baudoux (BCIM)</p>
449450
<ul class="simple">
450-
<li>The fill with stock action on stock.picking should not create manually
451-
the move lines but instead call <tt class="docutils literal">action_assign()</tt>. There are many
452-
modules hooking <tt class="docutils literal">action_assign</tt> that are not called due to this.</li>
451+
<li>The fill with stock action on stock.picking should not create
452+
manually the move lines but instead call <tt class="docutils literal">action_assign()</tt>. There
453+
are many modules hooking <tt class="docutils literal">action_assign</tt> that are not called due to
454+
this.</li>
453455
</ul>
454456
</div>
455457
<div class="section" id="bug-tracker">
456458
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
457459
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
458460
In case of trouble, please check there if your issue has already been reported.
459461
If you spotted it first, help us to smash it by providing a detailed and welcomed
460-
<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>
462+
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_move_location%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
461463
<p>Do not contact contributors directly about support or help with technical issues.</p>
462464
</div>
463465
<div class="section" id="credits">
@@ -495,6 +497,10 @@ <h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
495497
</li>
496498
<li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.eu">laurent.mignon&#64;acsone.eu</a>&gt;</li>
497499
<li>Maksym Yankin &lt;<a class="reference external" href="mailto:maksym.yankin&#64;camptocamp.com">maksym.yankin&#64;camptocamp.com</a>&gt;</li>
500+
<li>Open Source Integrators &lt;<a class="reference external" href="https://www.opensourceintegrators.com">https://www.opensourceintegrators.com</a>&gt;<ul>
501+
<li>Daniel Reis &lt;<a class="reference external" href="mailto:dreis&#64;opensourceintegrators.com">dreis&#64;opensourceintegrators.com</a>&gt;</li>
502+
</ul>
503+
</li>
498504
</ul>
499505
</div>
500506
<div class="section" id="maintainers">
@@ -506,7 +512,7 @@ <h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
506512
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
507513
mission is to support the collaborative development of Odoo features and
508514
promote its widespread use.</p>
509-
<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>
515+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/19.0/stock_move_location">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
510516
<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>
511517
</div>
512518
</div>

stock_move_location/tests/test_common.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ class TestsCommon(BaseCommon):
1010
@classmethod
1111
def setUpClass(cls):
1212
super().setUpClass()
13+
# Disable tracking for tests as recommended in Odoo 19.0 migration guide
14+
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
1315
cls.location_obj = cls.env["stock.location"]
1416
cls.product_obj = cls.env["product.product"]
1517
cls.wizard_obj = cls.env["wiz.stock.move.location"]
1618
cls.quant_obj = cls.env["stock.quant"]
1719
cls.company = cls.env.ref("base.main_company")
18-
cls.partner = cls.env.ref("base.res_partner_category_0")
20+
cls.partner = cls.env["res.partner"].create({"name": "Test Partner"})
1921

2022
cls.internal_loc_1 = cls.location_obj.create(
2123
{
@@ -90,10 +92,10 @@ def setUpClass(cls):
9092
"company_id": cls.company.id,
9193
}
9294
)
93-
cls.package = cls.env["stock.quant.package"].create({})
94-
cls.package1 = cls.env["stock.quant.package"].create({})
95+
cls.package = cls.env["stock.package"].create({})
96+
cls.package1 = cls.env["stock.package"].create({})
9597

96-
cls.package2 = cls.env["stock.quant.package"].create({})
98+
cls.package2 = cls.env["stock.package"].create({})
9799

98100
@classmethod
99101
def setup_product_amounts(cls):

stock_move_location/tests/test_move_location.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ def test_delivery_order_assignation_after_transfer(self):
283283
"""
284284
delivery_order_type = self.env.ref("stock.picking_type_out")
285285
internal_transfer_type = self.env.ref("stock.picking_type_internal")
286-
wh_stock_shelf_1 = self.env.ref("stock.stock_location_components")
287-
wh_stock_shelf_2 = self.env.ref("stock.stock_location_14")
286+
wh_stock_shelf_1 = self.env.ref("stock.stock_location_stock")
287+
wh_stock_shelf_2 = wh_stock_shelf_1.copy({"name": "Shelf 2"})
288288
wh_stock_shelf_3 = wh_stock_shelf_1.copy({"name": "Shelf 3"})
289289

290290
# Create some quants
@@ -297,7 +297,6 @@ def test_delivery_order_assignation_after_transfer(self):
297297
# delivery_picking.location_id = wh_stock_shelf_1
298298
delivery_move = self.env["stock.move"].create(
299299
{
300-
"name": "Delivery move",
301300
"product_id": self.product_lots.id,
302301
"product_uom_qty": 20.0,
303302
"product_uom": self.product_lots.uom_id.id,

0 commit comments

Comments
 (0)