From 03d99513188e492a1bf35f9141c30894a3eeb2d6 Mon Sep 17 00:00:00 2001 From: hda Date: Wed, 30 Nov 2022 14:41:40 +0100 Subject: [PATCH 1/2] [MIG] product_total_weight_from_packaging: Migration to 16.0 --- .../i18n/product_total_weight_from_packaging.pot | 2 ++ product_total_weight_from_packaging/readme/CONTRIBUTORS.rst | 1 + .../tests/test_product_total_weight_from_packaging.py | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/product_total_weight_from_packaging/i18n/product_total_weight_from_packaging.pot b/product_total_weight_from_packaging/i18n/product_total_weight_from_packaging.pot index 1afa53d99fa..cd95c8073b7 100644 --- a/product_total_weight_from_packaging/i18n/product_total_weight_from_packaging.pot +++ b/product_total_weight_from_packaging/i18n/product_total_weight_from_packaging.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-11-30 15:44+0000\n" +"PO-Revision-Date: 2022-11-30 15:44+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" diff --git a/product_total_weight_from_packaging/readme/CONTRIBUTORS.rst b/product_total_weight_from_packaging/readme/CONTRIBUTORS.rst index 3dcec14ca33..90ef3970916 100644 --- a/product_total_weight_from_packaging/readme/CONTRIBUTORS.rst +++ b/product_total_weight_from_packaging/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Akim Juillerat +* Hughes Damry * Duong (Tran Quoc) diff --git a/product_total_weight_from_packaging/tests/test_product_total_weight_from_packaging.py b/product_total_weight_from_packaging/tests/test_product_total_weight_from_packaging.py index 243b742f842..711a75b448b 100644 --- a/product_total_weight_from_packaging/tests/test_product_total_weight_from_packaging.py +++ b/product_total_weight_from_packaging/tests/test_product_total_weight_from_packaging.py @@ -1,9 +1,9 @@ # Copyright 2020 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) -from odoo.tests import common +from odoo.tests import TransactionCase -class TestProductTotalWeightFromPackaging(common.TransactionCase): +class TestProductTotalWeightFromPackaging(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() From 637765adc70fd05d192f4834f609f6a0eac9af43 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Wed, 12 Jul 2023 15:01:34 +0200 Subject: [PATCH 2/2] [FIX] product_total_weight_from_packaging. Uses weight in place of max_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 #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 --- .../readme/DESCRIPTION.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/product_total_weight_from_packaging/readme/DESCRIPTION.rst b/product_total_weight_from_packaging/readme/DESCRIPTION.rst index 681bd0038d6..9b5baa8aba9 100644 --- a/product_total_weight_from_packaging/readme/DESCRIPTION.rst +++ b/product_total_weight_from_packaging/readme/DESCRIPTION.rst @@ -4,3 +4,11 @@ taking into account the product packaging's weights and return the weight in the It uses the module `stock_packaging_calculator` to get weight from product packagings having a weight defined first and fallback on product weight field if no weight is defined on any of the packaging. + +.. warning:: + + This module 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**.