Skip to content

Conversation

sebalix
Copy link
Contributor

@sebalix sebalix commented Mar 17, 2025

And moved from OCA/stock-logistics-warehouse where it was already migrated (based on these comments: OCA/stock-logistics-warehouse#2173 (comment)).

As this module doesn't depend on stock, there is no need for this module to:

  • be hosted in a stock-logistics-* repository
  • be named with prefix stock_

As stock_packaging_calculator is already available in 18.0, it is transformed into a transitional module to install the new product_packaging_calculator:

simahawk and others added 30 commits March 17, 2025 14:28
Customizing the minimal unit was not needed at all.
This way we always assume the precision is the on of the UoM.
Allows to ship more information with each element in the list.
Optionally include contained packaging qty.
Allows to reuse the mapping every time is needed.
Make sure unit is always the last element in the list.
Use _packaging_values_handler ctx key to pass your own handler
for specific on demand overrides.
Retrieve quickly packagin bty qty as a string.
This mixin can be used to provide qty by packaging features
to any model.
Otherwise translations won't be taken into account.
This way no matter who's changing the behavior of the name getter
we'll get the right name.
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.

lgTM

env.cr, "stock_packaging_calculator"
) and not ou.is_module_installed(env.cr, "product_packaging_calculator"):
modules = [("stock_packaging_calculator", "product_packaging_calculator")]
ou.update_module_names(env.cr, modules, merge_modules=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One issue by doing this:

if we have stock_packaging_calculator installed, then we switch to its new version (transitional module), this will install product_packaging_calculator, and the hook here will remove stock_packaging_calculator entry from ir_module_module table. And if we still have other modules depending on this one, they have their dependencies broken (and could be uninstalled by mistake).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do a try with update_module_moved_fields + update_module_moved_models instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Working well with update_module_moved_fields + update_module_moved_models 👍 This keeps the existing stock_packaging_calculator module installed. Up to the admin to uninstall it afterwards.

…ator

And moved from OCA/stock-logistics-warehouse where it was already migrated.

As this module doesn't depend on `stock`, there is no need for this module to:
- be hosted in a stock-logistics-* repository
- be named with prefix `stock_`

`stock_packaging_calculator` will be transformed into a transitional
module to install the new `product_packaging_calculator`.
@sebalix sebalix force-pushed the 18-mig-stock_packaging_calculator branch from 30a5d2c to 1bd81d4 Compare March 18, 2025 15:00
@sebalix sebalix marked this pull request as ready for review March 18, 2025 15:01
@sebalix
Copy link
Contributor Author

sebalix commented Mar 18, 2025

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-1932-by-sebalix-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 82c1d86 into OCA:18.0 Mar 18, 2025
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at c1dc122. Thanks a lot for contributing to OCA. ❤️

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.