diff --git a/product_dimension/README.rst b/product_dimension/README.rst new file mode 100644 index 00000000000..a982e010cd0 --- /dev/null +++ b/product_dimension/README.rst @@ -0,0 +1,137 @@ +================= +Product Dimension +================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:33b715207dfb67e71c10e259f9ba52e6d1bab082fc6e9f805a351d54f17c7462 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_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_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 extends the functionality of product to support dimensions +(length, width and height). Also computes the volume automatically when +you change one of these dimensions. + +This module was previously hosted on +https://github.com/ingadhoc/odoo-addons and before that on +https://launchpad.net/~ingenieria-adhoc. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module : + +1. Go to Product View > Inventory +2. Edit Dimensional UoM and the three dimensions + +If the product has got more than one variant, the dimensions (and the +volume) are visible only in the variants. + +Changelog +========= + +| [ The change log. The goal of this file is to help readers +| understand changes between version. The primary audience is end users + and integrators. Purely technical changes such as code refactoring + must not be mentioned here. + +This file may contain ONE level of section titles, underlined with the ~ +(tilde) character. Other section markers are forbidden and will likely +break the structure of the README.rst or other documents where this +fragment is included. ] + +13.0.1.0.0 (2020-04-16) +----------------------- + +- [MIG] Migration from Odoo 12.0 to 13.0 +- [IMP] Black, isort, prettier + +16.0.1.0.0 (2022-10-11) +----------------------- + +- [MIG] Migration from Odoo 15.0 to 16.0 +- [IMP] Black, isort, prettier (pre-commit) + +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 +------- + +* brain-tec AG +* ADHOC SA +* Camptocamp SA + +Contributors +------------ + +- Juan Jose Scarafia +- Leonardo Pistone +- Denis Leemann +- Kumar Aberer +- `C2i Change 2 improve `__: + + - Eduardo Magdalena + +- Carlos Lopez +- `Trobz `__: + + - Thao Le + +Other credits +------------- + +The migration of this module from 16.0 to 17.0 was financially supported +by Camptocamp. + +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_dimension/__init__.py b/product_dimension/__init__.py new file mode 100644 index 00000000000..31660d6a965 --- /dev/null +++ b/product_dimension/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/product_dimension/__manifest__.py b/product_dimension/__manifest__.py new file mode 100644 index 00000000000..4ed0241e797 --- /dev/null +++ b/product_dimension/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2018 brain-tec AG (http://www.braintec-group.com) +# Copyright 2015-2016 Camptocamp SA +# Copyright 2015 ADHOC SA (http://www.adhoc.com.ar) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Product Dimension", + "version": "19.0.1.0.0", + "category": "Product", + "author": "brain-tec AG, ADHOC SA, Camptocamp SA, Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/product-attribute", + "depends": ["product"], + "data": ["views/product_view.xml"], + "installable": True, + "images": ["static/description/icon.png"], +} diff --git a/product_dimension/i18n/ca.po b/product_dimension/i18n/ca.po new file mode 100644 index 00000000000..7f5eb585da5 --- /dev/null +++ b/product_dimension/i18n/ca.po @@ -0,0 +1,93 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: product-attribute (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-22 01:40+0000\n" +"PO-Revision-Date: 2022-03-21 14:17+0000\n" +"Last-Translator: Noel estudillo \n" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-product-" +"attribute-9-0/language/ca/)\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_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +msgid "Dimensional UoM" +msgstr "UoM dimensional" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "Dimensions" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "Alçada" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "Llargada" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "Producte" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +msgid "UoM for length, height, width" +msgstr "UoM per a longitud, alçada i amplada" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "Amplada" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "alçada" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "llargada" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "amplada" + +#~ msgid "Product Template" +#~ msgstr "Plantilla de producte" diff --git a/product_dimension/i18n/de.po b/product_dimension/i18n/de.po new file mode 100644 index 00000000000..d220f8dbd3c --- /dev/null +++ b/product_dimension/i18n/de.po @@ -0,0 +1,91 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-15 10:11+0000\n" +"PO-Revision-Date: 2020-07-22 11:19+0000\n" +"Last-Translator: c2cdidier \n" +"Language-Team: \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 3.10\n" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +msgid "Dimensional UoM" +msgstr "Einheit d. Abmessungen" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "Abmessungen" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "Höhe" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "Länge" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "Produkt" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +msgid "UoM for length, height, width" +msgstr "Einheit für Länge, Höhe, Breite" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "Breite" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "Höhe" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "Länge" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "Breite" + +#~ msgid "Product Template" +#~ msgstr "Produktvorlage" diff --git a/product_dimension/i18n/es.po b/product_dimension/i18n/es.po new file mode 100644 index 00000000000..f9e0ad4a1b4 --- /dev/null +++ b/product_dimension/i18n/es.po @@ -0,0 +1,93 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: product-attribute (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-12-02 03:39+0000\n" +"PO-Revision-Date: 2023-08-29 08:30+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-product-" +"attribute-9-0/language/es/)\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_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +msgid "Dimensional UoM" +msgstr "Dimensiones UdM" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "Dimensiones" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "Alto" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "Largo" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "Producto" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "Variante del producto" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +msgid "UoM for length, height, width" +msgstr "UdM para largo, alto, ancho" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "Volumen" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "Ancho" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "Altura" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "longitud" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "Anchura" + +#~ msgid "Product Template" +#~ msgstr "Plantilla de producto" diff --git a/product_dimension/i18n/fr.po b/product_dimension/i18n/fr.po new file mode 100644 index 00000000000..0c3f9c493bd --- /dev/null +++ b/product_dimension/i18n/fr.po @@ -0,0 +1,95 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +# Translators: +# leemannd , 2016 +# leemannd , 2016 +msgid "" +msgstr "" +"Project-Id-Version: product-attribute (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-03 15:37+0000\n" +"PO-Revision-Date: 2020-07-22 11:19+0000\n" +"Last-Translator: c2cdidier \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-product-" +"attribute-9-0/language/fr/)\n" +"Language: fr\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 3.10\n" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +msgid "Dimensional UoM" +msgstr "UdM Dimensionnel" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "Dimensions" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "Hauteur" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "Longueur" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "Produit" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +msgid "UoM for length, height, width" +msgstr "UdM pour longueur, hauteur, largeur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "Largeur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "Hauteur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "Longueur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "Largeur" + +#~ msgid "Product Template" +#~ msgstr "Modèle de produit" diff --git a/product_dimension/i18n/fr_FR.po b/product_dimension/i18n/fr_FR.po new file mode 100644 index 00000000000..bf863cb3b7f --- /dev/null +++ b/product_dimension/i18n/fr_FR.po @@ -0,0 +1,98 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: product-attribute (9.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-22 01:40+0000\n" +"PO-Revision-Date: 2021-02-18 11:45+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: French (France) (http://www.transifex.com/oca/OCA-product-" +"attribute-9-0/language/fr_FR/)\n" +"Language: fr_FR\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_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +#, fuzzy +msgid "Dimensional UoM" +msgstr "UoM dimensionnelle" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "Dimensions" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "Hauteur" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "Longueur" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "Article" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +#, fuzzy +msgid "UoM for length, height, width" +msgstr "UoM pour longueur, hauteur, largeur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "Largeur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "Hauteur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "longueur" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "largeur" + +#~ msgid "Product Template" +#~ msgstr "Modèle d'article" + +#~ msgid "Brand" +#~ msgstr "Marque" diff --git a/product_dimension/i18n/it.po b/product_dimension/i18n/it.po new file mode 100644 index 00000000000..1276cab7188 --- /dev/null +++ b/product_dimension/i18n/it.po @@ -0,0 +1,87 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-04-27 15:33+0000\n" +"Last-Translator: Sebastiano Picchi \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.14.1\n" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +msgid "Dimensional UoM" +msgstr "UdM dimensionale" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "Dimensioni" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "Altezza" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "Lunghezza" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "Prodotto" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "Variante prodotto" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +msgid "UoM for length, height, width" +msgstr "UdM per lunghezza, altezza, larghezza" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "Volume" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "Larghezza" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "altezza" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "lunghezza" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "larghezza" diff --git a/product_dimension/i18n/product_dimension.pot b/product_dimension/i18n/product_dimension.pot new file mode 100644 index 00000000000..3f72d15621c --- /dev/null +++ b/product_dimension/i18n/product_dimension.pot @@ -0,0 +1,84 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +msgid "Dimensional UoM" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +msgid "UoM for length, height, width" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "" diff --git a/product_dimension/i18n/pt.po b/product_dimension/i18n/pt.po new file mode 100644 index 00000000000..71fc426a4b9 --- /dev/null +++ b/product_dimension/i18n/pt.po @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_dimension +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-03-23 14:13+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: none\n" +"Language: pt\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 3.10\n" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,field_description:product_dimension.field_product_template__dimensional_uom_id +msgid "Dimensional UoM" +msgstr "UdM das dimensões" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Dimensions" +msgstr "Dimensões" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Height" +msgstr "Altura" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Length" +msgstr "Comprimento" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_template +msgid "Product" +msgstr "Produto" + +#. module: product_dimension +#: model:ir.model,name:product_dimension.model_product_product +msgid "Product Variant" +msgstr "" + +#. module: product_dimension +#: model:ir.model.fields,help:product_dimension.field_product_product__dimensional_uom_id +#: model:ir.model.fields,help:product_dimension.field_product_template__dimensional_uom_id +msgid "UoM for length, height, width" +msgstr "UdM para comprimento, altura e largura" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__volume +#: model:ir.model.fields,field_description:product_dimension.field_product_template__volume +msgid "Volume" +msgstr "" + +#. module: product_dimension +#: model_terms:ir.ui.view,arch_db:product_dimension.product_normal_form_view +#: model_terms:ir.ui.view,arch_db:product_dimension.product_template_only_form_view +msgid "Width" +msgstr "Largura" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_height +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_height +msgid "height" +msgstr "altura" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_length +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_length +msgid "length" +msgstr "comprimento" + +#. module: product_dimension +#: model:ir.model.fields,field_description:product_dimension.field_product_product__product_width +#: model:ir.model.fields,field_description:product_dimension.field_product_template__product_width +msgid "width" +msgstr "largura" + +#~ msgid "Product Template" +#~ msgstr "Modelo de Produto" diff --git a/product_dimension/models/__init__.py b/product_dimension/models/__init__.py new file mode 100644 index 00000000000..498653ba71e --- /dev/null +++ b/product_dimension/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import product_template +from . import product_product diff --git a/product_dimension/models/product_product.py b/product_dimension/models/product_product.py new file mode 100644 index 00000000000..72bb9f16fd7 --- /dev/null +++ b/product_dimension/models/product_product.py @@ -0,0 +1,36 @@ +# Copyright 2015 ADHOC SA (http://www.adhoc.com.ar) +# Copyright 2015-2016 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ProductProduct(models.Model): + _inherit = "product.product" + + product_length = fields.Float("length") + product_height = fields.Float("height") + product_width = fields.Float("width") + dimensional_uom_id = fields.Many2one( + "uom.uom", + "Dimensional UoM", + help="UoM for length, height, width", + ) + volume = fields.Float( + compute="_compute_volume", + readonly=False, + store=True, + ) + + @api.depends( + "product_length", "product_height", "product_width", "dimensional_uom_id" + ) + def _compute_volume(self): + template_obj = self.env["product.template"] + for product in self: + product.volume = template_obj._calc_volume( + product.product_length, + product.product_height, + product.product_width, + product.dimensional_uom_id, + ) diff --git a/product_dimension/models/product_template.py b/product_dimension/models/product_template.py new file mode 100644 index 00000000000..e1c4aba7854 --- /dev/null +++ b/product_dimension/models/product_template.py @@ -0,0 +1,90 @@ +# Copyright 2015 ADHOC SA (http://www.adhoc.com.ar) +# Copyright 2015-2016 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + # Define all the related fields in product.template with 'readonly=False' + # to be able to modify the values from product.template. + dimensional_uom_id = fields.Many2one( + "uom.uom", + "Dimensional UoM", + default=lambda self: self.env.ref("uom.product_uom_meter"), + compute="_compute_dimensional_uom_id", + inverse="_inverse_dimensional_uom_id", + store=True, + help="UoM for length, height, width", + readonly=False, + ) + product_length = fields.Float( + related="product_variant_ids.product_length", readonly=False + ) + product_height = fields.Float( + related="product_variant_ids.product_height", readonly=False + ) + product_width = fields.Float( + related="product_variant_ids.product_width", readonly=False + ) + volume = fields.Float( + compute="_compute_volume", + readonly=False, + store=True, + ) + + @api.model + def _calc_volume(self, product_length, product_height, product_width, uom_id): + volume = 0 + if product_length and product_height and product_width and uom_id: + length_m = self.convert_to_meters(product_length, uom_id) + height_m = self.convert_to_meters(product_height, uom_id) + width_m = self.convert_to_meters(product_width, uom_id) + volume = length_m * height_m * width_m + + return volume + + @api.depends("product_variant_ids.dimensional_uom_id") + def _compute_dimensional_uom_id(self): + self._compute_template_field_from_variant_field("dimensional_uom_id") + + def _inverse_dimensional_uom_id(self): + self._set_product_variant_field("dimensional_uom_id") + + @api.depends( + "product_length", "product_height", "product_width", "dimensional_uom_id" + ) + def _compute_volume(self): + for template in self: + template.volume = template._calc_volume( + template.product_length, + template.product_height, + template.product_width, + template.dimensional_uom_id, + ) + + def convert_to_meters(self, measure, dimensional_uom): + uom_meters = self.env.ref("uom.product_uom_meter") + + return dimensional_uom._compute_quantity( + qty=measure, + to_unit=uom_meters, + round=False, + ) + + def _prepare_variant_values(self, combination): + """ + As variant is created inside template create() method and as + template fields values are flushed after _create_variant_ids(), + we catch the variant values preparation to update them + """ + res = super()._prepare_variant_values(combination) + if self.product_length: + res.update({"product_length": self.product_length}) + if self.product_height: + res.update({"product_height": self.product_height}) + if self.product_width: + res.update({"product_width": self.product_width}) + return res diff --git a/product_dimension/pyproject.toml b/product_dimension/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_dimension/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_dimension/readme/CONTRIBUTORS.md b/product_dimension/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..c3aa2f6fd44 --- /dev/null +++ b/product_dimension/readme/CONTRIBUTORS.md @@ -0,0 +1,11 @@ +- Juan Jose Scarafia \<\> +- Leonardo Pistone \<\> +- Denis Leemann \<\> +- Kumar Aberer \<\> +- [C2i Change 2 improve](http://www.c2i.es): + - Eduardo Magdalena \<\> +- Carlos Lopez \<\> +- [Trobz](https://trobz.com): + - Thao Le \<\> +- [Komit](https://komit-consulting.com/) + - Hieu Vo Minh Bao \<\> diff --git a/product_dimension/readme/CREDITS.md b/product_dimension/readme/CREDITS.md new file mode 100644 index 00000000000..8add88a2ebc --- /dev/null +++ b/product_dimension/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 16.0 to 17.0 was financially supported by Camptocamp. diff --git a/product_dimension/readme/DESCRIPTION.md b/product_dimension/readme/DESCRIPTION.md new file mode 100644 index 00000000000..9fc140755d7 --- /dev/null +++ b/product_dimension/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This module extends the functionality of product to support dimensions +(length, width and height). Also computes the volume automatically when +you change one of these dimensions. + +This module was previously hosted on + and before that on +. diff --git a/product_dimension/readme/HISTORY.md b/product_dimension/readme/HISTORY.md new file mode 100644 index 00000000000..2bae933150c --- /dev/null +++ b/product_dimension/readme/HISTORY.md @@ -0,0 +1,19 @@ +\[ The change log. The goal of this file is to help readers +understand changes between version. The primary audience is end users +and integrators. Purely technical changes such as code refactoring must +not be mentioned here. + +This file may contain ONE level of section titles, underlined with the ~ +(tilde) character. Other section markers are forbidden and will likely +break the structure of the README.rst or other documents where this +fragment is included. \] + +## 13.0.1.0.0 (2020-04-16) + +- \[MIG\] Migration from Odoo 12.0 to 13.0 +- \[IMP\] Black, isort, prettier + +## 16.0.1.0.0 (2022-10-11) + +- \[MIG\] Migration from Odoo 15.0 to 16.0 +- \[IMP\] Black, isort, prettier (pre-commit) diff --git a/product_dimension/readme/USAGE.md b/product_dimension/readme/USAGE.md new file mode 100644 index 00000000000..eefc1c48cd3 --- /dev/null +++ b/product_dimension/readme/USAGE.md @@ -0,0 +1,7 @@ +To use this module : + +1. Go to Product View \> Inventory +2. Edit Dimensional UoM and the three dimensions + +If the product has got more than one variant, the dimensions (and the +volume) are visible only in the variants. diff --git a/product_dimension/static/description/icon.png b/product_dimension/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_dimension/static/description/icon.png differ diff --git a/product_dimension/static/description/index.html b/product_dimension/static/description/index.html new file mode 100644 index 00000000000..4dcfe70efda --- /dev/null +++ b/product_dimension/static/description/index.html @@ -0,0 +1,491 @@ + + + + + +Product Dimension + + + +
+

Product Dimension

+ + +

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

+

This module extends the functionality of product to support dimensions +(length, width and height). Also computes the volume automatically when +you change one of these dimensions.

+

This module was previously hosted on +https://github.com/ingadhoc/odoo-addons and before that on +https://launchpad.net/~ingenieria-adhoc.

+

Table of contents

+ +
+

Usage

+

To use this module :

+
    +
  1. Go to Product View > Inventory
  2. +
  3. Edit Dimensional UoM and the three dimensions
  4. +
+

If the product has got more than one variant, the dimensions (and the +volume) are visible only in the variants.

+
+
+

Changelog

+
+
[ The change log. The goal of this file is to help readers
+
understand changes between version. The primary audience is end users +and integrators. Purely technical changes such as code refactoring +must not be mentioned here.
+
+

This file may contain ONE level of section titles, underlined with the ~ +(tilde) character. Other section markers are forbidden and will likely +break the structure of the README.rst or other documents where this +fragment is included. ]

+
+

13.0.1.0.0 (2020-04-16)

+
    +
  • [MIG] Migration from Odoo 12.0 to 13.0
  • +
  • [IMP] Black, isort, prettier
  • +
+
+
+

16.0.1.0.0 (2022-10-11)

+
    +
  • [MIG] Migration from Odoo 15.0 to 16.0
  • +
  • [IMP] Black, isort, prettier (pre-commit)
  • +
+
+
+
+

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

+
    +
  • brain-tec AG
  • +
  • ADHOC SA
  • +
  • Camptocamp SA
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 16.0 to 17.0 was financially supported +by Camptocamp.

+
+
+

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_dimension/tests/__init__.py b/product_dimension/tests/__init__.py new file mode 100644 index 00000000000..d026f47b8be --- /dev/null +++ b/product_dimension/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import test_compute_volume, test_template diff --git a/product_dimension/tests/test_compute_volume.py b/product_dimension/tests/test_compute_volume.py new file mode 100644 index 00000000000..0ab6edc2938 --- /dev/null +++ b/product_dimension/tests/test_compute_volume.py @@ -0,0 +1,55 @@ +# Copyright 2015 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase + + +class TestComputeVolumeOnProduct(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product = cls.env["product.product"].new() + cls.uom_m = cls.env["uom.uom"].search([("name", "=", "m")]) + # uom cm is archived by default + cls.uom_mm = cls.env["uom.uom"].search([("name", "=", "mm")]) + + def test_it_computes_volume_in_cm(self): + self.product.product_length = 100.0 + self.product.product_height = 2000.0 + self.product.product_width = 1000.0 + self.product.dimensional_uom_id = self.uom_mm + self.assertAlmostEqual(0.2, self.product.volume) + self.product.volume = 1.0 + self.assertAlmostEqual(1.0, self.product.volume) + + def test_it_computes_volume_in_meters(self): + self.product.product_length = 6.0 + self.product.product_height = 2.0 + self.product.product_width = 10.0 + self.product.dimensional_uom_id = self.uom_m + self.assertAlmostEqual(120, self.product.volume) + + +class TestComputeVolumeOnTemplate(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.template = cls.env["product.template"].new() + cls.uom_m = cls.env["uom.uom"].search([("name", "=", "m")]) + cls.uom_mm = cls.env["uom.uom"].search([("name", "=", "mm")]) + + def test_it_computes_volume_in_cm(self): + self.template.product_length = 100.0 + self.template.product_height = 2000.0 + self.template.product_width = 1000.0 + # uom cm is archived by default + self.template.dimensional_uom_id = self.uom_mm + self.assertAlmostEqual(0.2, self.template.volume) + self.template.volume = 1.0 + self.assertAlmostEqual(1.0, self.template.volume) + + def test_it_computes_volume_in_meters(self): + self.template.product_length = 6.0 + self.template.product_height = 2.0 + self.template.product_width = 10.0 + self.template.dimensional_uom_id = self.uom_m + self.assertAlmostEqual(120, self.template.volume) diff --git a/product_dimension/tests/test_template.py b/product_dimension/tests/test_template.py new file mode 100644 index 00000000000..b9d1166030c --- /dev/null +++ b/product_dimension/tests/test_template.py @@ -0,0 +1,38 @@ +# Copyright 2022 ACSONE SA/NV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase + + +class TestTemplateValues(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.product_template = cls.env["product.template"].create( + { + "name": "Unittest P1", + "product_length": 10.0, + "product_width": 5.0, + "product_height": 3.0, + "uom_id": cls.env.ref("uom.product_uom_unit").id, + "type": "consu", + } + ) + + def test_template(self): + """ + Data: + one product template with dimensions + Test Case: + get the product associated to the product_template and + check that the length, width and height + are the same as for the product template + Expected result: + length, width, height are the same on the product and product template + """ + + product = self.product_template.product_variant_ids + + self.assertEqual(product.product_length, 10.0) + self.assertEqual(product.product_width, 5.0) + self.assertEqual(product.product_height, 3.0) diff --git a/product_dimension/views/product_view.xml b/product_dimension/views/product_view.xml new file mode 100644 index 00000000000..8a629c7dd88 --- /dev/null +++ b/product_dimension/views/product_view.xml @@ -0,0 +1,37 @@ + + + + product_normal_form_view + product.product + + + + + + + + + + + + + + product_template_form_view + product.template + + + + + + + + + + + + +