Skip to content

[19.0][MIG] product_total_weight_from_packaging - #2368

Draft
JasminSForgeFlow wants to merge 27 commits into
OCA:19.0from
ForgeFlow:19.0-mig-product_total_weight_from_packaging
Draft

JasminSForgeFlow wants to merge 27 commits into
OCA:19.0from
ForgeFlow:19.0-mig-product_total_weight_from_packaging

Conversation

@JasminSForgeFlow

@JasminSForgeFlow JasminSForgeFlow commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Dependency change

product_packaging_dimensionproduct_packaging.

Odoo 19 removed the product.packaging model, and in 19.0 the OCA split puts the
packaging weight on the new product_packaging module, while
product_packaging_dimension keeps dimensions only. This module only needs the
weight, so it now depends on product_packaging directly.

Depends on:

Changes

  • get_total_weight_from_packaging() reworked for the 19.0 packaging model:
    product_packaging_calculator now yields packagings identified by their
    uom.uom, so packaging weights are looked up on product.packaging keyed by
    uom_id instead of browsing product.packaging by the calculator id.
  • Weight UoM conversion removed. In 19.0 a packaging has no weight_uom_id
    anymore (product.packaging.weight_uom_name is related to the product's), so
    packaging weights and the product weight are already expressed in the same UoM
    and summing them directly is correct. The dependency on product_logistics_uom
    (through product_packaging_dimension) is therefore no longer needed, and the
    README warning about the missing conversions is obsolete.
  • Behaviour is unchanged: packagings without a weight are still ignored, so their
    quantity falls back to the smaller packagings and finally to the product weight.

@ForgeFlow

grindtildeath and others added 27 commits August 4, 2026 15:45
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: product-attribute-16.0/product-attribute-16.0-product_total_weight_from_packaging
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_total_weight_from_packaging/
…x_weight

The max_weight is a concept that was introduced in odoo delivery module to define the transporter weight limit for the shipped packaging. Before v16, the transporter packaging and product packaging was the same model product.packaging. Now the transporter packaging is moved to the model stock.package.type.
In v13, max_weight defined in delivery module on product.packaging was used also for product packaging dimension.
In v14, the weight field was added on the product.packaging and the max_weight was still coming from delivery module. This was introducing inconsistency as some modules migrated from v13 to v14 still rely on max_weight and some rely on the new weight field.
In v16, we have to drop this max_weight on product.packaging as the delivery module moved it to stock.package.type and we should rely only on the weight field.
The migration of the product_packaging_dimension OCA#1161 has to be fixed to not expose the old max_weight field and any data on max_weight must be moved to weight if empty.

This module also deserves a big warning that it is lacking the weight uom conversions as it depends on product_packaging_dimension that depends on product_logistics_uom that allows to set a uom on the weight. The sum in this module is assuming all weights are in kg

Co-authored-by: Jacques-Etienne Baudoux <je@bcim.be>
Currently translated at 100.0% (1 of 1 strings)

Translation: product-attribute-18.0/product-attribute-18.0-product_total_weight_from_packaging
Translate-URL: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_total_weight_from_packaging/sl/
@OCA-git-bot OCA-git-bot added series:19.0 mod:product_total_weight_from_packaging Module product_total_weight_from_packaging labels Aug 6, 2026
@legalsylvain
legalsylvain marked this pull request as draft August 6, 2026 13:17

@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 + code. LGTM

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

Labels

mod:product_total_weight_from_packaging Module product_total_weight_from_packaging series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.