Skip to content

Commit 017352e

Browse files
committed
[MIG] stock_picking_batch_extended: Migration to 16.0
1 parent 5c6fbbb commit 017352e

File tree

15 files changed

+103
-105
lines changed

15 files changed

+103
-105
lines changed

stock_picking_batch_extended/__manifest__.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 18 deletions
This file was deleted.

stock_picking_batch_extended/models/stock_batch_picking.py

Lines changed: 1 addition & 26 deletions
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(

stock_picking_batch_extended/readme/DESCRIPTION.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ After having created a batch with a list of stock picking, you can:
1717
* Make partial delivery by filling done quantities in pack operations tab.
1818
* Print a report to pick the proper goods at once
1919

20-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/stock_picking_list.png
20+
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/stock_picking_list.jpg
2121
:alt: Sample report template
2222
:width: 80 %
2323
:align: center
2424

25-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_wizard.png
25+
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_wizard.jpg
2626
:alt: Sample report template
2727
:width: 80 %
2828
:align: center
2929

30-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form.png
30+
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form.jpg
3131
:alt: Sample report template
3232
:width: 80 %
3333
:align: center
3434

35-
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form_operation.png
35+
.. figure:: https://raw.githubusercontent.com/OCA/stock-logistics-workflow/11.0/stock_batch_picking/static/batch_form_operation.jpg
3636
:alt: Sample report template
3737
:width: 80 %
3838
:align: center

stock_picking_batch_extended/report/batch_report.py

Lines changed: 3 additions & 3 deletions
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
96.9 KB
Loading
-55.9 KB
Binary file not shown.
76.1 KB
Loading
-50.6 KB
Binary file not shown.
40.9 KB
Loading

0 commit comments

Comments
 (0)