Skip to content

[19.0][MIG] product_packaging_calculator - #2363

Open
JasminSForgeFlow wants to merge 9 commits into
OCA:19.0from
ForgeFlow:19.0-mig-product_packaging_calculator
Open

[19.0][MIG] product_packaging_calculator#2363
JasminSForgeFlow wants to merge 9 commits into
OCA:19.0from
ForgeFlow:19.0-mig-product_packaging_calculator

Conversation

@JasminSForgeFlow

Copy link
Copy Markdown
Contributor

Standard Migration

@ForgeFlow

Sébastien Alix and others added 9 commits July 23, 2026 11:32
…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`.
…oaded

With the changes introduced in odoo/odoo@de056cc#diff-b37c7fd5520c97a29ddc59495779e7be61a66e15e85603928e27b3affb9dc31f, an error was occurring because the change validation on the model was being performed before tearDownClass was executed. Therefore, it has been modified so that the mock changes are applied in each test and cleaned up after each test. This way, the error will no longer appear and the test will run normally.
Currently translated at 100.0% (5 of 5 strings)

Translation: product-attribute-18.0/product-attribute-18.0-product_packaging_calculator
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_packaging_calculator/sl/
@OCA-git-bot OCA-git-bot added series:19.0 mod:product_packaging_calculator Module product_packaging_calculator labels Aug 4, 2026
@AaronHForgeFlow

Copy link
Copy Markdown
Contributor

the commits before the module rename are missing, I am not sure this is something we can fix at this point, I think that had to be done in the PR of the rename 😕 according to this: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-19.0

If the module is renamed in the migration, you have to rename the whole commit history. If not done, on the next version, when these commands will be executed again, only the latest commit will be brought. For doing the renaming, execute the following commands:

git filter-branch --tree-filter 'if [ -d $module ]; then mv $module $new_module_name; fi' HEAD
git rebase origin/19.0

@AaronHForgeFlow AaronHForgeFlow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Functional review + code LGTM. Just minor comments.


The minimal quantity is always represented by the UoM of the product.

Limitation: fractional quantities are lost.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think fractionals are covered, see models/product.py:145-152

from odoo import api, models
from odoo.tools import float_compare, float_is_zero, float_round

from odoo.addons.base_sparse_field.models.fields import Serialized

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you know why base_sparse_field is not a dependency in the manifest?

return self[self._qty_by_pkg__product_field_name]

def _qty_by_packaging_get_qty(self):
return self[self._qty_by_pkg__qty_field_name]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

perhaps we can cover the case where self._qty_by_pkg__qty_field_name is None?

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

Labels

mod:product_packaging_calculator Module product_packaging_calculator series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants