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] product_total_weight_from_packaging: Migration to 18.0 #1792

Merged

Conversation

Kimkhoi3010
Copy link

@Kimkhoi3010 Kimkhoi3010 commented Dec 2, 2024

No description provided.

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.

LG

Comment on lines 6 to 10
class TestProductTotalWeightFromPackaging(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
Copy link
Contributor

@jbaudoux jbaudoux Dec 30, 2024

Choose a reason for hiding this comment

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

Shouldn't this extend TestProductCommon instead ? Then no need for tracking_disable

Suggested change
class TestProductTotalWeightFromPackaging(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
from odoo.addons.product.tests.common import TestProductCommon
class TestProductTotalWeightFromPackaging(TestProductCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()

grindtildeath and others added 21 commits December 31, 2024 09:57
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 <[email protected]>
@Kimkhoi3010 Kimkhoi3010 force-pushed the 18.0-mig-product_total_weight_from_packaging branch from d8b48f9 to 13f532d Compare December 31, 2024 02:57
@Kimkhoi3010 Kimkhoi3010 requested a review from jbaudoux December 31, 2024 03:00
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.

:)

Copy link
Contributor

@ajaniszewska-dev ajaniszewska-dev left a comment

Choose a reason for hiding this comment

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

LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@sebalix
Copy link
Contributor

sebalix commented Jan 23, 2025

/ocabot migration product_total_weight_from_packaging

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Jan 23, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Jan 23, 2025
44 tasks
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["stock_packaging_calculator", "product_packaging_dimension"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Once OCA/stock-logistics-warehouse#2173 (comment) done

Suggested change
"depends": ["stock_packaging_calculator", "product_packaging_dimension"],
"depends": ["product_packaging_calculator", "product_packaging_dimension"],

Copy link
Contributor

Choose a reason for hiding this comment

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

PR here: #1932

@Kimkhoi3010 Kimkhoi3010 force-pushed the 18.0-mig-product_total_weight_from_packaging branch from 13f532d to f423916 Compare March 18, 2025 02:53
@Kimkhoi3010 Kimkhoi3010 requested a review from jbaudoux March 18, 2025 02:56
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.

Can you update the pr description depends on with the new PR?

@simahawk
Copy link
Contributor

pending pr merged

@Kimkhoi3010 Kimkhoi3010 force-pushed the 18.0-mig-product_total_weight_from_packaging branch from f423916 to 3a6303b Compare March 19, 2025 02:44
@simahawk
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-1792-by-simahawk-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8628c5a into OCA:18.0 Mar 19, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 4687db4. 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.