Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] stock_picking_batch_extended: Migration to 18.0 #1855

Open
wants to merge 52 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
fd7b27d
[FIX] stock_picking_mass_action return backorder if any of pickings n…
Sep 24, 2019
39f72d9
[12.0][FIX] stock_picking_batch_extended
AdriaGForgeFlow Oct 22, 2019
5b6ff38
[MIG] stock_picking_batch_extended: Migration scripts
pedrobaeza Dec 10, 2019
460caec
[FIX] stock_picking_batch_extended: float_is_zero required parameters
carlosdauden Dec 18, 2019
f622b99
[IMP] stock_picking_batch_extended: UX improvements
carlosdauden Dec 19, 2019
85d6a8b
[IMP] stock_picking_batch_extended: Add followers, attachments, chatt…
carlosdauden Feb 26, 2020
231490c
[IMP] stock_picking_batch_extended: Request confirmation to cancel pi…
sergio-teruel Oct 6, 2020
41e138a
[IMP] stock_picking_batch_extended: black, isort, prettier
pedrobaeza Dec 29, 2020
d8a696f
[MIG] stock_picking_batch_extended: Migration to 13.0
sergio-teruel Dec 29, 2020
68c8209
[IMP] stock_picking_batch_extended: Add kanban view in batch action f…
sergio-teruel Apr 7, 2021
b83a6c6
stock_picking_batch_extended 13.0.1.1.0
OCA-git-bot Apr 9, 2021
91fa013
[IMP] stock_picking_batch_extended: Add optional picking_count column…
carlosdauden Jul 28, 2021
f77b2ba
stock_picking_batch_extended 13.0.1.2.0
OCA-git-bot Jul 30, 2021
670fe69
[IMP] stock_picking_batch_extended: Add confirm to validate and done …
victoralmau Sep 10, 2021
6593163
stock_picking_batch_extended 13.0.1.3.0
OCA-git-bot Sep 10, 2021
6741982
[IMP] stock_picking_batch_extended: black, isort, prettier
Dec 6, 2021
b045dae
[MIG] [14.0] stock_picking_batch_extended: Migration to 14.0
Dec 9, 2021
9e660df
[IMP] add post-init hook to apply settings
Jan 5, 2020
b328d10
[MIG] stock_picking_batch_extended: Migration to 15.0
cesar-tecnativa Jul 13, 2022
0960f0d
[IMP] stock_picking_batch_extended: Refactor. Odoo has improved batch…
sergio-teruel Oct 27, 2022
b81ea70
[UPD] Update stock_picking_batch_extended.pot
Dec 14, 2022
e6ff417
Translated using Weblate (Italian)
mymage Mar 23, 2023
90d43be
Translated using Weblate (Slovenian)
sysadminmatmoz Mar 31, 2023
a7a323a
[IMP] stock_picking_batch_extended: Display standard picking tree vie…
sergio-teruel Apr 19, 2023
2b4384e
[FIX] stock_picking_batch_extended: Administration settings required.…
carlosdauden Apr 19, 2023
45ee5d8
stock_picking_batch_extended 15.0.2.0.1
OCA-git-bot Apr 19, 2023
ecb2a45
stock_picking_batch_extended 15.0.2.1.0
OCA-git-bot Apr 19, 2023
e49958a
[IMP] stock_picking_batch_extended: Display batch picking in form view
sergio-teruel Apr 21, 2023
e2cc5af
stock_picking_batch_extended 15.0.2.2.0
OCA-git-bot Apr 24, 2023
dc9fc57
[FIX] stock_picking_batch_extended: New batch is created when existin…
carlosdauden May 8, 2023
0b1caa1
stock_picking_batch_extended 15.0.2.2.1
OCA-git-bot May 10, 2023
c7f0587
[FIX] stock_picking_batch_extended: An user without Administrator gro…
sergio-teruel May 11, 2023
ec1ac65
Translated using Weblate (Italian)
francesco-ooops May 17, 2023
465c349
stock_picking_batch_extended 15.0.2.3.0
OCA-git-bot May 25, 2023
650f479
[MIG] stock_picking_batch_extended: Migration to 16.0
RodrigoBM Aug 9, 2023
c4f8dc7
stock_picking_batch_extended 16.0.1.0.1
OCA-git-bot Sep 8, 2023
1ec7f8f
Translated using Weblate (Spanish)
Ivorra78 Sep 15, 2023
cc33752
Translated using Weblate (Spanish)
Ivorra78 Oct 15, 2023
e21adcc
[FIX] stock_picking_batch_extended: correction of the url of the read…
RodrigoBM Oct 17, 2023
794b80d
[REF] stock_picking_batch_extended: readme is changed for better comp…
RodrigoBM Oct 19, 2023
c450435
[REF] stock_picking_batch_extended: Move settings option under Batch …
Shide Oct 19, 2023
ed5bf48
Translated using Weblate (Italian)
francesco-ooops Nov 2, 2023
e6cd55b
Translated using Weblate (Italian)
mymage Nov 21, 2023
d5596ec
Translated using Weblate (Italian)
mymage Dec 24, 2023
505adfa
Translated using Weblate (Portuguese (Brazil))
adrianojprado Dec 27, 2023
b4417df
Translated using Weblate (Italian)
mymage Jan 25, 2024
4394b81
Translated using Weblate (Italian)
mymage Feb 16, 2024
e546377
Translated using Weblate (Portuguese (Brazil))
May 29, 2024
19a1a5b
Translated using Weblate (Italian)
mymage Jun 4, 2024
208da54
[FIX] stock_picking_batch_extended: Printed batch report instead of p…
sergio-teruel Aug 30, 2024
a3a7973
[IMP] stock_picking_batch_extended: pre-commit auto fixes
yankinmax Jan 27, 2025
3d36345
[MIG] stock_picking_batch_extended: Migration to 18.0
yankinmax Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stock_picking_batch_extended/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{
"name": "Stock batch picking extended",
"summary": "Allows manage a lot of pickings in batch",
"version": "16.0.1.1.1",
"version": "18.0.1.0.0",
"author": "Camptocamp, " "Tecnativa, " "Odoo Community Association (OCA)",
"development_status": "Mature",
"maintainers": ["gurneyalex", "carlosdauden", "i-vyshnevska"],
"category": "Warehouse Management",
"depends": ["stock_picking_batch", "delivery"],
"depends": ["stock_picking_batch", "stock_delivery"],
"website": "https://github.com/OCA/stock-logistics-workflow",
"data": [
"security/ir.model.access.csv",
Expand Down
6 changes: 1 addition & 5 deletions stock_picking_batch_extended/hooks.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2019 Camptocamp - Iryna Vyshnevska
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import SUPERUSER_ID, api


def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})

def post_init_hook(env):
env["res.company"].search([]).write({"use_oca_batch_validation": True})
2 changes: 1 addition & 1 deletion stock_picking_batch_extended/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ msgid "Warehouse"
msgstr "Warenlager"

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr "Warenlager-Beschreibung"
Expand Down
2 changes: 1 addition & 1 deletion stock_picking_batch_extended/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ msgid "Warehouse"
msgstr "Almacén"

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr "Descripción del almacén"
Expand Down
2 changes: 1 addition & 1 deletion stock_picking_batch_extended/i18n/es_CL.po
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ msgid "Warehouse"
msgstr "Bodega"

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr "Descripción de Bodega"
Expand Down
2 changes: 1 addition & 1 deletion stock_picking_batch_extended/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ msgid "Warehouse"
msgstr ""

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr "Warehouse Description"
Expand Down
2 changes: 1 addition & 1 deletion stock_picking_batch_extended/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ msgid "Warehouse"
msgstr "Magazzino"

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr "Descrizione magazzino"
Expand Down
2 changes: 1 addition & 1 deletion stock_picking_batch_extended/i18n/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ msgid "Warehouse"
msgstr "Armazém"

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr "Descrição do Armazém"
Expand Down
2 changes: 1 addition & 1 deletion stock_picking_batch_extended/i18n/sl.po
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ msgid "Warehouse"
msgstr "Skladišče"

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr "Opis skladišča"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ msgid "Warehouse"
msgstr ""

#. module: stock_picking_batch_extended
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_warehouse
#: model:ir.model.fields,field_description:stock_picking_batch_extended.field_product_product__description_picking
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_extended.product_normal_form_view
msgid "Warehouse Description"
msgstr ""
Expand Down
16 changes: 16 additions & 0 deletions stock_picking_batch_extended/migrations/18.0.1.0.0/pre-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2025 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


def migrate(cr, version):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration script is needed to handle the return to an existent field description_picking from custom description_warehouse
It was requested in TODO

cr.execute("""
UPDATE product_template
SET description_picking =
CASE
WHEN description_picking IS NOT NULL THEN
description_picking || '\n' || description_warehouse
ELSE
description_warehouse
END
WHERE description_warehouse IS NOT NULL;
""")
1 change: 1 addition & 0 deletions stock_picking_batch_extended/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import res_company
from . import res_config_settings
from . import stock_batch_picking
from . import product_product
Expand Down
8 changes: 4 additions & 4 deletions stock_picking_batch_extended/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from odoo import fields, models


class Product(models.Model):
_inherit = "product.product"
# TODO: Integrate in existent field
description_warehouse = fields.Text("Warehouse Description", translate=True)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose description_picking is the field we want to return to

class ProductTemplate(models.Model):
_inherit = "product.template"

description_picking = fields.Text(string="Warehouse Description", translate=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see where this is used. Should be in a separate module

10 changes: 10 additions & 0 deletions stock_picking_batch_extended/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2019 Camptocamp - Iryna Vyshnevska
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class Company(models.Model):
_inherit = "res.company"

use_oca_batch_validation = fields.Boolean()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the OCA way? This is not clear, help missing. Rename field

6 changes: 0 additions & 6 deletions stock_picking_batch_extended/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ class ResConfigSettings(models.TransientModel):
related="company_id.use_oca_batch_validation",
readonly=False,
)


class Company(models.Model):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following conventions I've moved this class definition to a separate file.

_inherit = "res.company"

use_oca_batch_validation = fields.Boolean()
9 changes: 4 additions & 5 deletions stock_picking_batch_extended/models/stock_batch_picking.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2012-2014 Alexandre Fayolle, Camptocamp SA
# Copyright 2018-2020 Tecnativa - Carlos Dauden
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, fields, models
from odoo import fields, models
from odoo.exceptions import UserError


Expand All @@ -12,13 +12,12 @@ class StockPickingBatch(models.Model):

name = fields.Char(
index=True,
states={"draft": [("readonly", False)]},
readonly=False, # allow edition in draft state
)
date = fields.Date(
required=True,
readonly=True,
readonly=False, # allow edition in draft,in_progress state
index=True,
states={"draft": [("readonly", False)], "in_progress": [("readonly", False)]},
default=fields.Date.context_today,
help="date on which the batch picking is to be processed",
)
Expand Down Expand Up @@ -66,7 +65,7 @@ def action_cancel(self):
def action_print_picking(self):
pickings = self.mapped("picking_ids")
if not pickings:
raise UserError(_("Nothing to print."))
raise UserError(self.env._("Nothing to print."))
return self.env.ref("stock.action_report_delivery").report_action(
self.picking_ids
)
Expand Down
4 changes: 3 additions & 1 deletion stock_picking_batch_extended/report/batch_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@

@api.model
def key_level_0(self, operation):
return operation.location_id.id, operation.location_dest_id.id

Check warning on line 17 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L17

Added line #L17 was not covered by tests

@api.model
def key_level_1(self, operation):
return operation.product_id.id

Check warning on line 21 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L21

Added line #L21 was not covered by tests

@api.model
def new_level_0(self, operation):
level_0_name = f"{operation.location_id.name_get()[0][1]} \u21e8 {operation.location_dest_id.name_get()[0][1]}"
location_name = operation.location_id.name_get()[0][1]
location_dest_name = operation.location_dest_id.name_get()[0][1]
level_0_name = f"{location_name} \u21e8 {location_dest_name}"
return {

Check warning on line 28 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L25-L28

Added lines #L25 - L28 were not covered by tests
"name": level_0_name,
"location": operation.location_id,
"location_dest": operation.location_dest_id,
Expand All @@ -32,7 +34,7 @@

@api.model
def _get_operation_qty(self, operation):
return (

Check warning on line 37 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L37

Added line #L37 was not covered by tests
float_is_zero(
operation.reserved_qty,
precision_rounding=operation.product_uom_id.rounding,
Expand All @@ -43,7 +45,7 @@

@api.model
def new_level_1(self, operation):
return {

Check warning on line 48 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L48

Added line #L48 was not covered by tests
"product": operation.product_id,
"product_qty": self._get_operation_qty(operation),
"operations": operation,
Expand All @@ -51,12 +53,12 @@

@api.model
def update_level_1(self, group_dict, operation):
group_dict["product_qty"] += self._get_operation_qty(operation)
group_dict["operations"] += operation

Check warning on line 57 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L56-L57

Added lines #L56 - L57 were not covered by tests

@api.model
def sort_level_0(self, rec_list):
return sorted(

Check warning on line 61 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L61

Added line #L61 was not covered by tests
rec_list,
key=lambda rec: (
rec["location"].posx,
Expand All @@ -68,34 +70,34 @@

@api.model
def sort_level_1(self, rec_list):
return sorted(

Check warning on line 73 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L73

Added line #L73 was not covered by tests
rec_list,
key=lambda rec: (rec["product"].default_code or "", rec["product"].id),
)

@api.model
def _get_grouped_data(self, batch):
grouped_data = {}

Check warning on line 80 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L80

Added line #L80 was not covered by tests
for op in batch.move_line_ids:
l0_key = self.key_level_0(op)

Check warning on line 82 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L82

Added line #L82 was not covered by tests
if l0_key not in grouped_data:
grouped_data[l0_key] = self.new_level_0(op)
l1_key = self.key_level_1(op)

Check warning on line 85 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L84-L85

Added lines #L84 - L85 were not covered by tests
if l1_key in grouped_data[l0_key]["l1_items"]:
self.update_level_1(grouped_data[l0_key]["l1_items"][l1_key], op)

Check warning on line 87 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L87

Added line #L87 was not covered by tests
else:
grouped_data[l0_key]["l1_items"][l1_key] = self.new_level_1(op)

Check warning on line 89 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L89

Added line #L89 was not covered by tests
for l0_key in grouped_data.keys():
grouped_data[l0_key]["l1_items"] = self.sort_level_1(

Check warning on line 91 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L91

Added line #L91 was not covered by tests
grouped_data[l0_key]["l1_items"].values()
)
return self.sort_level_0(grouped_data.values())

Check warning on line 94 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L94

Added line #L94 was not covered by tests

@api.model
def _get_report_values(self, docids, data=None):
model = "stock.picking.batch"
docs = self.env[model].browse(docids)
return {

Check warning on line 100 in stock_picking_batch_extended/report/batch_report.py

View check run for this annotation

Codecov / codecov/patch

stock_picking_batch_extended/report/batch_report.py#L98-L100

Added lines #L98 - L100 were not covered by tests
"doc_ids": docids,
"doc_model": model,
"data": data,
Expand Down
Loading
Loading