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

Conversation

yankinmax
Copy link

No description provided.

Iryna Vyshnevska and others added 30 commits January 27, 2025 10:51
- Converts old stock.batch.picking in stock.picking.batch
- Restore link in stock.picking
- Other needed stuff
Currently translated at 21.4% (15 of 70 strings)

Translation: stock-logistics-workflow-15.0/stock-logistics-workflow-15.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_batch_extended/it/
Currently translated at 87.1% (61 of 70 strings)

Translation: stock-logistics-workflow-15.0/stock-logistics-workflow-15.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_batch_extended/sl/
…g mode is selected. Don't save last option when batch_by_group is unchecked.

TT42965 TT43055
RodrigoBM and others added 13 commits January 27, 2025 10:52
…Picking group

[REF] stock_picking_batch_extended: update picking_batch_configuration_settings img configuration
Currently translated at 22.2% (14 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/it/
Currently translated at 100.0% (63 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/it/
Currently translated at 100.0% (63 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/it/
Currently translated at 84.1% (53 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/pt_BR/
Currently translated at 100.0% (63 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/it/
Currently translated at 100.0% (63 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/it/
Currently translated at 100.0% (63 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/pt_BR/
Currently translated at 100.0% (63 of 63 strings)

Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_picking_batch_extended
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_picking_batch_extended/it/
…icking report on "print deliveries" button

TT50661
@yankinmax yankinmax force-pushed the 18.0-mig-stock_picking_batch_extended branch from 13ea03a to 3d36345 Compare January 28, 2025 11:29
# 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

Comment on lines 9 to 10
# 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

"product_uom_qty": 1,
"location_id": cls.stock_loc.id,
"location_dest_id": cls.customer_loc.id,
"product_uom_qty": 10,
Copy link
Author

Choose a reason for hiding this comment

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

I propose to increase the quantity to easily simulate partial and backorder usage behavior

@@ -256,8 +264,7 @@ def test_backorder(self):
self.assertEqual(self.product6, backorder.move_ids[0].product_id)
self.assertEqual(2, backorder.move_ids[0].product_uom_qty)
self.assertEqual(1, len(backorder.move_line_ids))
self.assertEqual(2, backorder.move_line_ids[0].reserved_uom_qty)
self.assertEqual(0, backorder.move_line_ids[0].qty_done)
Copy link
Author

Choose a reason for hiding this comment

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

qty_done is not an attribute of stock.move.line anymore


def test_package(self):
warehouse = self.browse_ref("stock.warehouse0")
Copy link
Author

Choose a reason for hiding this comment

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

This test was failing. I've checked the OCA code doesn't modify the behavior of packaging, so I've rewritten the code with the standard way.

@@ -168,24 +168,3 @@ def action_view_batch_picking(self, batch_pickings):
else:
action = batch_pickings.get_formview_action()
return action


class StockBatchPickingCreatorGroupField(models.TransientModel):
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.

@@ -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.

@rousseldenis
Copy link
Contributor

/ocabot migration stock_picking_batch_extended

@@ -0,0 +1,6 @@
In Inventory / Settings / Batch Picking it is possible to activate or
deactivate which approach for batch handling will be used per company.
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be great to describe which one.

Copy link

@gaetan-vaujour gaetan-vaujour left a comment

Choose a reason for hiding this comment

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

Functional validation is OK

@rousseldenis
Copy link
Contributor

IMHO those kind of modules should be avoided. As it is very difficult for users to determine what is the real purpose of it.

Copy link
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

Warf! This module is doing too many different things.
Can you split in several modules? One meaningful group of features per module.
And try to find meaningful module names

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.