diff --git a/product_packaging_dimension/README.rst b/product_packaging_dimension/README.rst new file mode 100644 index 000000000000..6960da64d572 --- /dev/null +++ b/product_packaging_dimension/README.rst @@ -0,0 +1,83 @@ +=========================== +Product Packaging Dimension +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:c556ebaf29d95a99a2215007040a43f5e0b8c7aa5c9c5712be92bef2c5cb56fe + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/18.0/product_packaging_dimension + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-18-0/product-attribute-18-0-product_packaging_dimension + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to store dimensions (length, width, height), weight +and volume of product packagings. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Camptocamp +* Akretion + +Contributors +------------ + +- Patrick Tombez +- Akim Juillerat +- Kévin Roche +- Fernando La Chica +- Denis Roussel +- Nhan Tran + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_packaging_dimension/__init__.py b/product_packaging_dimension/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/product_packaging_dimension/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_packaging_dimension/__manifest__.py b/product_packaging_dimension/__manifest__.py new file mode 100644 index 000000000000..ae75a66e865f --- /dev/null +++ b/product_packaging_dimension/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +{ + "name": "Product Packaging Dimension", + "summary": "Manage packaging dimensions and weight", + "version": "18.0.1.0.0", + "category": "Product", + "author": "Camptocamp, Akretion, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "product", + "product_logistics_uom", + ], + "website": "https://github.com/OCA/product-attribute", + "data": [ + "views/product_packaging.xml", + ], + "installable": True, +} diff --git a/product_packaging_dimension/i18n/ca.po b/product_packaging_dimension/i18n/ca.po new file mode 100644 index 000000000000..f2f276e3ab2d --- /dev/null +++ b/product_packaging_dimension/i18n/ca.po @@ -0,0 +1,155 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_packaging_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-03-22 13:17+0000\n" +"Last-Translator: Noel estudillo \n" +"Language-Team: none\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Dimensions" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "Dimensions Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_height +msgid "Height must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__packaging_length +msgid "Length" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_length +msgid "Length must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_name +msgid "Length unit of measure label" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Packaging volume unit of measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model,name:product_packaging_dimension.model_product_packaging +msgid "Product Packaging" +msgstr "Empaquetat de producte" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "The Packaging volume" +msgstr "" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "UoM for packaging length, height, width (based on lenght UoM)" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_name +msgid "Volume Unit of Measure label" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Volume Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Weight" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Unit of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_weight +msgid "Weight must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_name +msgid "Weight unit of measure label" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_width +msgid "Width must be positive" +msgstr "" + +#~ msgid "Height (mm)" +#~ msgstr "Alçacada (mm)" + +#~ msgid "Length (mm)" +#~ msgstr "Longitud (mm)" + +#~ msgid "Volume (m³)" +#~ msgstr "Volum (m³)" + +#~ msgid "Weight (kg)" +#~ msgstr "Pes (kg)" + +#~ msgid "Width (mm)" +#~ msgstr "Amplada (mm)" + +#~ msgid "height in millimeters" +#~ msgstr "alçada en milímetres" + +#~ msgid "length in millimeters" +#~ msgstr "longitud en milímetres" + +#~ msgid "volume in cubic meters" +#~ msgstr "volum en metres cúbics" + +#~ msgid "width in millimeters" +#~ msgstr "amplada en milímetres" diff --git a/product_packaging_dimension/i18n/de.po b/product_packaging_dimension/i18n/de.po new file mode 100644 index 000000000000..6ecea64e7abd --- /dev/null +++ b/product_packaging_dimension/i18n/de.po @@ -0,0 +1,139 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_packaging_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-11-04 14:44+0000\n" +"Last-Translator: Maria Sparenberg \n" +"Language-Team: none\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Dimensions" +msgstr "Dimensionen" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "Dimensions Units of Measure" +msgstr "ME der Dimensionen" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height" +msgstr "Höhe" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_height +msgid "Height must be positive" +msgstr "Die Höhe muss positiv sein." + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__packaging_length +msgid "Length" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_length +msgid "Length must be positive" +msgstr "Die Länge muss positiv sein." + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_name +msgid "Length unit of measure label" +msgstr "Label für Längen-ME" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Packaging volume unit of measure" +msgstr "Volumen-ME (Verpackung)" + +#. module: product_packaging_dimension +#: model:ir.model,name:product_packaging_dimension.model_product_packaging +msgid "Product Packaging" +msgstr "Produktverpackung" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "The Packaging volume" +msgstr "Dies ist das Volumen der Verpackung." + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Units of Measure" +msgstr "Mengeneinheit" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "UoM for packaging length, height, width (based on lenght UoM)" +msgstr "" +"Dies ist die Mengeneinheit für die Länge, Höhe und Breite der Verpackung, " +"bezogen auf die Längen-ME." + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume" +msgstr "Volumen" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_name +msgid "Volume Unit of Measure label" +msgstr "Label für Volumen-ME" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Volume Units of Measure" +msgstr "Volumen-ME" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Weight" +msgstr "Gewicht" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Unit of Measure" +msgstr "Gewicht-ME" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Units of Measure" +msgstr "Gewicht-ME" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_weight +msgid "Weight must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_name +msgid "Weight unit of measure label" +msgstr "Label für Gewicht-ME" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width" +msgstr "Breite" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_width +msgid "Width must be positive" +msgstr "Die Breite muss positiv sein." + +#~ msgid "Max Weight must be positive" +#~ msgstr "Das maximale Gewicht muss positiv sein." + +#~ msgid "Maximum Weight" +#~ msgstr "Max. Gewicht" + +#~ msgid "Packaging Length" +#~ msgstr "Länge (Verpackung)" diff --git a/product_packaging_dimension/i18n/es.po b/product_packaging_dimension/i18n/es.po new file mode 100644 index 000000000000..afdd29005082 --- /dev/null +++ b/product_packaging_dimension/i18n/es.po @@ -0,0 +1,156 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_packaging_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-09 18:29+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Dimensions" +msgstr "Dimensiones" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "Dimensions Units of Measure" +msgstr "Dimensiones Unidades de medida" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height" +msgstr "Altura" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_height +msgid "Height must be positive" +msgstr "La altura debe ser positiva" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__packaging_length +msgid "Length" +msgstr "Longitud" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_length +msgid "Length must be positive" +msgstr "La longitud debe ser positiva" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_name +msgid "Length unit of measure label" +msgstr "Etiqueta de unidad de medida de longitud" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Packaging volume unit of measure" +msgstr "Unidad de medida del volumen del envase" + +#. module: product_packaging_dimension +#: model:ir.model,name:product_packaging_dimension.model_product_packaging +msgid "Product Packaging" +msgstr "Empaquetado de producto" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "The Packaging volume" +msgstr "El volumen de embalaje" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Units of Measure" +msgstr "Unidades de Medida" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "UoM for packaging length, height, width (based on lenght UoM)" +msgstr "" +"UM de longitud, altura y anchura del envase (basada en la UM de longitud)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume" +msgstr "Volumen" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_name +msgid "Volume Unit of Measure label" +msgstr "Etiqueta de unidad de Medida de Volumen" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Volume Units of Measure" +msgstr "Unidades de Medida de Volumen" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Weight" +msgstr "Peso" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Unit of Measure" +msgstr "Unidad de Medida del Peso" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Units of Measure" +msgstr "Unidades de Medida del peso" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_weight +msgid "Weight must be positive" +msgstr "El peso debe ser positivo" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_name +msgid "Weight unit of measure label" +msgstr "Etiqueta de unidad de medida de peso" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width" +msgstr "Anchura" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_width +msgid "Width must be positive" +msgstr "La anchura debe ser positiva" + +#~ msgid "Height (mm)" +#~ msgstr "Altura (mm)" + +#~ msgid "Length (mm)" +#~ msgstr "Longitud(mm)" + +#~ msgid "Volume (m³)" +#~ msgstr "Volumen(m³)" + +#~ msgid "Weight (kg)" +#~ msgstr "Peso (kg)" + +#~ msgid "Width (mm)" +#~ msgstr "Amplitud (mm)" + +#~ msgid "height in millimeters" +#~ msgstr "altura en milímetros" + +#~ msgid "length in millimeters" +#~ msgstr "longitud en milímetros" + +#~ msgid "volume in cubic meters" +#~ msgstr "volumen en metros cúbicos" + +#~ msgid "width in millimeters" +#~ msgstr "amplitud en milímetros" diff --git a/product_packaging_dimension/i18n/it.po b/product_packaging_dimension/i18n/it.po new file mode 100644 index 000000000000..f97c044c266b --- /dev/null +++ b/product_packaging_dimension/i18n/it.po @@ -0,0 +1,139 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_packaging_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-26 17:33+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Dimensions" +msgstr "Dimensioni" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "Dimensions Units of Measure" +msgstr "Unità di misura per le dimensioni" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height" +msgstr "Altezza" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_height +msgid "Height must be positive" +msgstr "L'altezza deve essere positiva" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__packaging_length +msgid "Length" +msgstr "Lunghezza" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_length +msgid "Length must be positive" +msgstr "La lunghezza deve essere positiva" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_name +msgid "Length unit of measure label" +msgstr "Etichetta unità di misura lunghezza" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Packaging volume unit of measure" +msgstr "Unità di misura per il volume dell'imballaggio" + +#. module: product_packaging_dimension +#: model:ir.model,name:product_packaging_dimension.model_product_packaging +msgid "Product Packaging" +msgstr "Imballaggio prodotto" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "The Packaging volume" +msgstr "Volume dell'imballaggio" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Units of Measure" +msgstr "Unità di misura" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "UoM for packaging length, height, width (based on lenght UoM)" +msgstr "" +"UdM per lunghezza, altezza, larghezza (basato sull'UdM della lunghezza) " +"dell'imballaggio" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume" +msgstr "Volume" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_name +msgid "Volume Unit of Measure label" +msgstr "Etichetta unità di misura volume" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Volume Units of Measure" +msgstr "Unità di misura del volume" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Weight" +msgstr "Peso" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Unit of Measure" +msgstr "Unità di misura del peso" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Units of Measure" +msgstr "Unità di misura del peso" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_weight +msgid "Weight must be positive" +msgstr "Il peso deve essere positivo" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_name +msgid "Weight unit of measure label" +msgstr "Etichetta unità di misura peso" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width" +msgstr "Larghezza" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_width +msgid "Width must be positive" +msgstr "La larghezza deve essere positiva" + +#~ msgid "Max Weight must be positive" +#~ msgstr "Il peso massimo deve essere positivo" + +#~ msgid "Maximum Weight" +#~ msgstr "Peso massimo" + +#~ msgid "Packaging Length" +#~ msgstr "Lunghezza imballaggio" diff --git a/product_packaging_dimension/i18n/product_packaging_dimension.pot b/product_packaging_dimension/i18n/product_packaging_dimension.pot new file mode 100644 index 000000000000..15a7059729d4 --- /dev/null +++ b/product_packaging_dimension/i18n/product_packaging_dimension.pot @@ -0,0 +1,125 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_packaging_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Dimensions" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "Dimensions Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_height +msgid "Height must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__packaging_length +msgid "Length" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_length +msgid "Length must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__length_uom_name +msgid "Length unit of measure label" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Packaging volume unit of measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model,name:product_packaging_dimension.model_product_packaging +msgid "Product Packaging" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "The Packaging volume" +msgstr "" + +#. module: product_packaging_dimension +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__length_uom_id +msgid "UoM for packaging length, height, width (based on lenght UoM)" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_name +msgid "Volume Unit of Measure label" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__volume_uom_id +msgid "Volume Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight +#: model_terms:ir.ui.view,arch_db:product_packaging_dimension.product_packaging_form_view_inherit +msgid "Weight" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Unit of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_id +msgid "Weight Units of Measure" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_weight +msgid "Weight must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__weight_uom_name +msgid "Weight unit of measure label" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_width +msgid "Width must be positive" +msgstr "" diff --git a/product_packaging_dimension/models/__init__.py b/product_packaging_dimension/models/__init__.py new file mode 100644 index 000000000000..2c4d9a88a376 --- /dev/null +++ b/product_packaging_dimension/models/__init__.py @@ -0,0 +1 @@ +from . import product_packaging diff --git a/product_packaging_dimension/models/product_packaging.py b/product_packaging_dimension/models/product_packaging.py new file mode 100644 index 000000000000..a75256e24814 --- /dev/null +++ b/product_packaging_dimension/models/product_packaging.py @@ -0,0 +1,122 @@ +# Copyright 2019-2021 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +from odoo import api, fields, models + + +class ProductPackaging(models.Model): + _inherit = "product.packaging" + # Constraints and dimensional field names are identical + # to product_packaging.py in delivery. + # The redundancy here avoids unnecessary dependencies on sale modules. + + _sql_constraints = [ + ("positive_height", "CHECK(height>=0)", "Height must be positive"), + ("positive_width", "CHECK(width>=0)", "Width must be positive"), + ("positive_length", "CHECK(packaging_length>=0)", "Length must be positive"), + ( + "positive_weight", + "CHECK(weight>=0)", + "Weight must be positive", + ), + ] + height = fields.Integer() + width = fields.Integer() + packaging_length = fields.Integer(string="Length") + + length_uom_id = fields.Many2one( + "uom.uom", + "Dimensions Units of Measure", + domain=lambda self: [ + ("category_id", "=", self.env.ref("uom.uom_categ_length").id) + ], + help="UoM for packaging length, height, width (based on lenght UoM)", + default=lambda self: self.env[ + "product.template" + ]._get_length_uom_id_from_ir_config_parameter(), + ) + length_uom_name = fields.Char( + string="Length unit of measure label", + related="length_uom_id.name", + ) + + weight = fields.Float() + weight_uom_id = fields.Many2one( + "uom.uom", + string="Weight Units of Measure", + domain=lambda self: [ + ("category_id", "=", self.env.ref("uom.product_uom_categ_kgm").id) + ], + help="Weight Unit of Measure", + default=lambda self: self.env[ + "product.template" + ]._get_weight_uom_id_from_ir_config_parameter(), + ) + + weight_uom_name = fields.Char( + string="Weight unit of measure label", + related="weight_uom_id.name", + ) + + volume = fields.Float( + digits=(8, 4), + compute="_compute_volume", + help="The Packaging volume", + ) + + volume_uom_id = fields.Many2one( + "uom.uom", + string="Volume Units of Measure", + domain=lambda self: [ + ("category_id", "=", self.env.ref("uom.product_uom_categ_vol").id) + ], + help="Packaging volume unit of measure", + default=lambda self: self.env[ + "product.template" + ]._get_volume_uom_id_from_ir_config_parameter(), + ) + + volume_uom_name = fields.Char( + string="Volume Unit of Measure label", + related="volume_uom_id.name", + ) + + @api.depends( + "packaging_length", "width", "height", "length_uom_id", "volume_uom_id" + ) + def _compute_volume(self): + for packaging in self: + packaging.volume = packaging._calculate_volume( + packaging.packaging_length, + packaging.height, + packaging.width, + packaging.length_uom_id, + packaging.volume_uom_id, + ) + + def _calculate_volume( + self, packaging_length, height, width, length_uom_id, volume_uom_id + ): + volume_m3 = 0 + if packaging_length and height and width and length_uom_id: + length_m = self.convert_to_meters(packaging_length, length_uom_id) + height_m = self.convert_to_meters(height, length_uom_id) + width_m = self.convert_to_meters(width, length_uom_id) + volume_m3 = length_m * height_m * width_m + volume_in_volume_uom = self.convert_to_volume_uom(volume_m3, volume_uom_id) + return volume_in_volume_uom + + def convert_to_meters(self, measure, length_uom_id): + uom_meters = self.env.ref("uom.product_uom_meter") + return length_uom_id._compute_quantity( + qty=measure, + to_unit=uom_meters, + round=False, + ) + + def convert_to_volume_uom(self, measure, volume_uom_id): + uom_m3 = self.env.ref("uom.product_uom_cubic_meter") + return uom_m3._compute_quantity( + qty=measure, + to_unit=volume_uom_id, + round=False, + ) diff --git a/product_packaging_dimension/pyproject.toml b/product_packaging_dimension/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/product_packaging_dimension/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_packaging_dimension/readme/CONTRIBUTORS.md b/product_packaging_dimension/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..b1c05a785498 --- /dev/null +++ b/product_packaging_dimension/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- Patrick Tombez \<\> +- Akim Juillerat \<\> +- Kévin Roche \<\> +- Fernando La Chica \<\> +- Denis Roussel \<\> +- Nhan Tran \<\> diff --git a/product_packaging_dimension/readme/DESCRIPTION.md b/product_packaging_dimension/readme/DESCRIPTION.md new file mode 100644 index 000000000000..1478e009536e --- /dev/null +++ b/product_packaging_dimension/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module allows to store dimensions (length, width, height), weight +and volume of product packagings. diff --git a/product_packaging_dimension/static/description/icon.png b/product_packaging_dimension/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/product_packaging_dimension/static/description/icon.png differ diff --git a/product_packaging_dimension/static/description/index.html b/product_packaging_dimension/static/description/index.html new file mode 100644 index 000000000000..8e980a2ea9ce --- /dev/null +++ b/product_packaging_dimension/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +Product Packaging Dimension + + + +
+

Product Packaging Dimension

+ + +

Beta License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runboat

+

This module allows to store dimensions (length, width, height), weight +and volume of product packagings.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/product-attribute project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/product_packaging_dimension/tests/__init__.py b/product_packaging_dimension/tests/__init__.py new file mode 100644 index 000000000000..029b81441579 --- /dev/null +++ b/product_packaging_dimension/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import test_packaging_volume diff --git a/product_packaging_dimension/tests/test_packaging_volume.py b/product_packaging_dimension/tests/test_packaging_volume.py new file mode 100644 index 000000000000..31f198ead978 --- /dev/null +++ b/product_packaging_dimension/tests/test_packaging_volume.py @@ -0,0 +1,108 @@ +# Copyright (C) 2021 Akretion (). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestPackagingVolumeCompute(TransactionCase): + @classmethod + def setUpClass(self): + super().setUpClass() + + self.packaging = self.env["product.packaging"].new() + self.packaging2 = self.env["product.packaging"].new() + self.packaging3 = self.env["product.packaging"].new() + + self.uom_m = self.env["uom.uom"].search([("name", "=", "m")]) + self.uom_cm = self.env["uom.uom"].search([("name", "=", "cm")]) + self.uom_L = self.env["uom.uom"].search([("name", "=", "L")]) + self.uom_m3 = self.env["uom.uom"].search([("name", "=", "m³")]) + self.uom_ft = self.env["uom.uom"].search([("name", "=", "ft")]) + self.uom_ft3 = self.env["uom.uom"].search([("name", "=", "ft³")]) + + def test_input_uom(self): + # Volume always in m3 (using default parameter), but with different initial UoM. + + # Initial dimensions in meter + self.packaging.packaging_length = 10.0 + self.packaging.height = 10.0 + self.packaging.width = 10.0 + self.packaging.length_uom_id = self.uom_m + self.packaging.volume_uom_id = self.uom_m3 + self.packaging._compute_volume() + self.assertEqual(1000, self.packaging.volume) + + # Initial dimensions in cm + self.packaging2.packaging_length = 10.0 + self.packaging2.height = 10.0 + self.packaging2.width = 10.0 + self.packaging2.length_uom_id = self.uom_cm + self.packaging2.volume_uom_id = self.uom_m3 + self.packaging2._compute_volume() + self.assertEqual(0.001, self.packaging2.volume) + + # Initial dimensions in feet + self.packaging3.packaging_length = 10.0 + self.packaging3.height = 10.0 + self.packaging3.width = 10.0 + self.packaging3.length_uom_id = self.uom_ft + self.packaging3.volume_uom_id = self.uom_m3 + self.packaging3._compute_volume() + self.assertEqual(28.3168, self.packaging3.volume) + + def test_compute_volume(self): + # initial UoM always in meters and Volume in m3, but with different dimensions. + + self.packaging.packaging_length = 10 + self.packaging.height = 8 + self.packaging.width = 10 + self.packaging.length_uom_id = self.uom_m + self.packaging.volume_uom_id = self.uom_m3 + self.packaging._compute_volume() + self.assertEqual(800, self.packaging.volume) + + self.packaging2.packaging_length = 6.0 + self.packaging2.height = 14.0 + self.packaging2.width = 1.0 + self.packaging2.length_uom_id = self.uom_m + self.packaging2.volume_uom_id = self.uom_m3 + self.packaging2._compute_volume() + self.assertEqual(84.0, self.packaging2.volume) + + self.packaging3.packaging_length = 100.0 + self.packaging3.height = 50 + self.packaging3.width = 80 + self.packaging3.length_uom_id = self.uom_m + self.packaging3.volume_uom_id = self.uom_m3 + self.packaging3._compute_volume() + self.assertEqual(400000, self.packaging3.volume) + + def test_output_uom(self): + # Tests with both different initial and volume UoMs. + + # feet to Liters + self.packaging.packaging_length = 10.0 + self.packaging.height = 10.0 + self.packaging.width = 10.0 + self.packaging.length_uom_id = self.uom_ft + self.packaging.volume_uom_id = self.uom_L + self.packaging._compute_volume() + self.assertAlmostEqual(28316.8439, self.packaging.volume) + + # cm to cubic feet + self.packaging2.packaging_length = 10.0 + self.packaging2.height = 10.0 + self.packaging2.width = 10.0 + self.packaging2.length_uom_id = self.uom_cm + self.packaging2.volume_uom_id = self.uom_ft3 + self.packaging2._compute_volume() + self.assertAlmostEqual(0.0353, self.packaging2.volume) + + # meters to cubic feet + self.packaging3.packaging_length = 10.0 + self.packaging3.height = 10.0 + self.packaging3.width = 10.0 + self.packaging3.length_uom_id = self.uom_m + self.packaging3.volume_uom_id = self.uom_ft3 + self.packaging3._compute_volume() + self.assertAlmostEqual(35314.7248, self.packaging3.volume) diff --git a/product_packaging_dimension/views/product_packaging.xml b/product_packaging_dimension/views/product_packaging.xml new file mode 100644 index 000000000000..a1e2ccc58fd2 --- /dev/null +++ b/product_packaging_dimension/views/product_packaging.xml @@ -0,0 +1,62 @@ + + + + product.packaging.form.view.inherit + product.packaging + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000000..4cf09ec3209d --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-product_logistics_uom @ git+https://github.com/OCA/product-attribute.git@refs/pull/1751/head#subdirectory=product_logistics_uom