Skip to content

Commit b073d4b

Browse files
committed
[MIG] stock_picking_batch_extended: Migration to 16.0
1 parent c12764e commit b073d4b

20 files changed

+221
-193
lines changed

stock_picking_batch_extended/README.rst

+34-26
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
Stock batch picking extended
33
============================
44

5-
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
67
!! This file is generated by oca-gen-addon-readme !!
78
!! changes will be overwritten. !!
89
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:d3b1e8122824b2d74e420e8685475bfc3267e6030c89555de6a082f389cb9e7a
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
912
1013
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
1114
:target: https://odoo-community.org/page/development-status
@@ -14,52 +17,57 @@ Stock batch picking extended
1417
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1518
:alt: License: AGPL-3
1619
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github
17-
:target: https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_batch_extended
20+
:target: https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_batch_extended
1821
:alt: OCA/stock-logistics-workflow
1922
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_batch_extended
23+
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended
2124
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/154/15.0
24-
:alt: Try me on Runbot
25-
26-
|badge1| |badge2| |badge3| |badge4| |badge5|
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-workflow&target_branch=16.0
27+
:alt: Try me on Runboat
2728

28-
This module is based on `picking_dispatch <https://github.com/OCA/stock-logistics-workflow/tree/8.0/picking_dispatch>`_
29-
but reworked for matching Odoo new picking system (with pack operations).
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
3030

31-
Since v12 it is compatible with odoo addon https://github.com/odoo/odoo/blob/12.0/addons/stock_picking_batch/models/stock_picking_batch.py
3231
It allows to define which approach for batch handling will be used per company.
3332
By default after installation this option will be activated for all companies, you can disable
3433
it in settings.
3534

36-
Batch picking allows you to manage several pickings at the same time.
37-
You can create a batch with all pickings selected or multiple batch depends on
38-
a group field selected in wizard.
35+
.. figure::/stock_picking_batch_extended/static/picking_batch_configuration_settings.jpg
36+
:alt: Picking batch configuration settings
37+
:width: 80 %
38+
:align: center
3939

40-
After having created a batch with a list of stock picking, you can:
40+
Wizard of add to batch whit the option "a new batch transfer", you can:
4141

42-
* Check availability and reserve quants for all pickings
43-
* Mark all pickings as done when delivery is done.
44-
* Make partial delivery by filling done quantities in pack operations tab.
45-
* Print a report to pick the proper goods at once
42+
* Assign the name of the new batch.
43+
* Add notes to the notes field of the new batch.
44+
* Create a batch with all pickings selected or multiple batch depends on a group field selected in wizard.
4645

47-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/stock_picking_list.png
46+
.. figure::/stock_picking_batch_extended/static/stock_picking_list.jpg
4847
:alt: Sample report template
4948
:width: 80 %
5049
:align: center
5150

52-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_wizard.png
51+
.. figure:: https://raw.githubusercontent.com/stock_picking_batch_extended/static/batch_wizard.jpg
5352
:alt: Sample report template
5453
:width: 80 %
5554
:align: center
5655

57-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form.png
56+
After having created a batch with a list of stock picking, you can:
57+
58+
* Allows to rename the batch if it is in the draft status.
59+
* Add field date, on which the batch picking is to be processed.
60+
* Add field notes.
61+
* Add picking count to form view.
62+
* If a batch is cancelled, cancel for all batches pickings and set batches states to cancel too only if user set OCA batch validation approach.
63+
* You can remove all batch pickings from the batch whose status is not done or cancelled.
64+
65+
.. figure:: https://raw.githubusercontent.com/stock_picking_batch_extended/static/batch_form.jpg
5866
:alt: Sample report template
5967
:width: 80 %
6068
:align: center
6169

62-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form_operation.png
70+
.. figure:: https://raw.githubusercontent.com/stock_picking_batch_extended/static/batch_form_operation.jpg
6371
:alt: Sample report template
6472
:width: 80 %
6573
:align: center
@@ -74,8 +82,8 @@ Bug Tracker
7482

7583
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/issues>`_.
7684
In case of trouble, please check there if your issue has already been reported.
77-
If you spotted it first, help us smashing it by providing a detailed and welcomed
78-
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_batch_extended%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
85+
If you spotted it first, help us to smash it by providing a detailed and welcomed
86+
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_batch_extended%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
7987

8088
Do not contact contributors directly about support or help with technical issues.
8189

@@ -153,6 +161,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
153161

154162
|maintainer-gurneyalex| |maintainer-carlosdauden| |maintainer-i-vyshnevska|
155163

156-
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_batch_extended>`_ project on GitHub.
164+
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_batch_extended>`_ project on GitHub.
157165

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

stock_picking_batch_extended/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"name": "Stock batch picking extended",
77
"summary": "Allows manage a lot of pickings in batch",
8-
"version": "15.0.2.3.0",
8+
"version": "16.0.1.0.0",
99
"author": "Camptocamp, " "Tecnativa, " "Odoo Community Association (OCA)",
1010
"development_status": "Mature",
1111
"maintainers": ["gurneyalex", "carlosdauden", "i-vyshnevska"],

stock_picking_batch_extended/migrations/15.0.1.0/pre-migration.py

-18
This file was deleted.

stock_picking_batch_extended/models/stock_batch_picking.py

+1-26
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# Copyright 2012-2014 Alexandre Fayolle, Camptocamp SA
22
# Copyright 2018-2020 Tecnativa - Carlos Dauden
33
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4-
from odoo import _, api, fields, models
4+
from odoo import _, fields, models
55
from odoo.exceptions import UserError
66

77

88
class StockPickingBatch(models.Model):
99
"""This object allow to manage multiple stock.picking at the same time."""
1010

11-
# renamed stock.batch.picking -> stock.picking.batch
1211
_inherit = "stock.picking.batch"
1312

1413
name = fields.Char(
@@ -37,35 +36,11 @@ class StockPickingBatch(models.Model):
3736
help="List of active picking managed by this batch.",
3837
)
3938
notes = fields.Text(help="free form remarks")
40-
entire_package_ids = fields.Many2many(
41-
comodel_name="stock.quant.package",
42-
compute="_compute_entire_package_ids",
43-
help="Those are the entire packages of a picking shown in the view of "
44-
"operations",
45-
)
46-
entire_package_detail_ids = fields.Many2many(
47-
comodel_name="stock.quant.package",
48-
compute="_compute_entire_package_ids",
49-
help="Those are the entire packages of a picking shown in the view of "
50-
"detailed operations",
51-
)
5239
picking_count = fields.Integer(
5340
string="# Pickings",
5441
compute="_compute_picking_count",
5542
)
5643

57-
@api.depends("picking_ids")
58-
def _compute_entire_package_ids(self):
59-
for batch in self:
60-
batch.update(
61-
{
62-
"entire_package_ids": batch.use_oca_batch_validation
63-
and batch.picking_ids.mapped("entire_package_ids" or False),
64-
"entire_package_detail_ids": batch.use_oca_batch_validation
65-
and batch.picking_ids.mapped("entire_package_detail_ids" or False),
66-
}
67-
)
68-
6944
def _compute_picking_count(self):
7045
"""Calculate number of pickings."""
7146
groups = self.env["stock.picking"].read_group(
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
1-
This module is based on `picking_dispatch <https://github.com/OCA/stock-logistics-workflow/tree/8.0/picking_dispatch>`_
2-
but reworked for matching Odoo new picking system (with pack operations).
3-
4-
Since v12 it is compatible with odoo addon https://github.com/odoo/odoo/blob/12.0/addons/stock_picking_batch/models/stock_picking_batch.py
51
It allows to define which approach for batch handling will be used per company.
62
By default after installation this option will be activated for all companies, you can disable
73
it in settings.
84

9-
Batch picking allows you to manage several pickings at the same time.
10-
You can create a batch with all pickings selected or multiple batch depends on
11-
a group field selected in wizard.
5+
.. figure::/stock_picking_batch_extended/static/picking_batch_configuration_settings.jpg
6+
:alt: Picking batch configuration settings
7+
:width: 80 %
8+
:align: center
129

13-
After having created a batch with a list of stock picking, you can:
10+
Wizard of add to batch whit the option "a new batch transfer", you can:
1411

15-
* Check availability and reserve quants for all pickings
16-
* Mark all pickings as done when delivery is done.
17-
* Make partial delivery by filling done quantities in pack operations tab.
18-
* Print a report to pick the proper goods at once
12+
* Assign the name of the new batch.
13+
* Add notes to the notes field of the new batch.
14+
* Create a batch with all pickings selected or multiple batch depends on a group field selected in wizard.
1915

20-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/stock_picking_list.png
16+
.. figure::/stock_picking_batch_extended/static/stock_picking_list.jpg
2117
:alt: Sample report template
2218
:width: 80 %
2319
:align: center
2420

25-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_wizard.png
21+
.. figure:: /stock_picking_batch_extended/static/batch_wizard.jpg
2622
:alt: Sample report template
2723
:width: 80 %
2824
:align: center
2925

30-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form.png
26+
After having created a batch with a list of stock picking, you can:
27+
28+
* Allows to rename the batch if it is in the draft status.
29+
* Add field date, on which the batch picking is to be processed.
30+
* Add field notes.
31+
* Add picking count to form view.
32+
* If a batch is cancelled, cancel for all batches pickings and set batches states to cancel too only if user set OCA batch validation approach.
33+
* You can remove all batch pickings from the batch whose status is not done or cancelled.
34+
35+
.. figure:: /stock_picking_batch_extended/static/batch_form.jpg
3136
:alt: Sample report template
3237
:width: 80 %
3338
:align: center
3439

35-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form_operation.png
40+
.. figure:: /stock_picking_batch_extended/static/batch_form_operation.jpg
3641
:alt: Sample report template
3742
:width: 80 %
3843
:align: center

stock_picking_batch_extended/report/batch_report.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import logging
44

55
from odoo import api, fields, models
6-
from odoo.tools import float_is_zero
6+
from odoo.tools.float_utils import float_is_zero
77

88
_logger = logging.getLogger(__name__)
99

@@ -37,11 +37,11 @@ def new_level_0(self, operation):
3737
def _get_operation_qty(self, operation):
3838
return (
3939
float_is_zero(
40-
operation.product_qty,
40+
operation.reserved_qty,
4141
precision_rounding=operation.product_uom_id.rounding,
4242
)
4343
and operation.qty_done
44-
or operation.product_qty
44+
or operation.reserved_qty
4545
)
4646

4747
@api.model
Loading
Binary file not shown.
Loading
Binary file not shown.
Loading
Binary file not shown.

0 commit comments

Comments
 (0)