From 0549fcf871c81969f78c2e2725fc88191b9139b4 Mon Sep 17 00:00:00 2001 From: clementmbr Date: Fri, 20 Mar 2020 12:34:39 -0300 Subject: [PATCH 01/22] [12.0] Add product_packaging_dimension --- product_packaging_dimension/README.rst | 81 ++++ product_packaging_dimension/__init__.py | 1 + product_packaging_dimension/__manifest__.py | 18 + .../i18n/product_packaging_dimension.pot | 65 +++ .../models/__init__.py | 1 + .../models/product_packaging.py | 28 ++ .../readme/CONTRIBUTORS.rst | 2 + .../readme/DESCRIPTION.rst | 3 + .../readme/ROADMAP.rst | 1 + .../static/description/icon.png | Bin 0 -> 9455 bytes .../static/description/index.html | 428 ++++++++++++++++++ .../views/product_packaging.xml | 19 + 12 files changed, 647 insertions(+) create mode 100644 product_packaging_dimension/README.rst create mode 100644 product_packaging_dimension/__init__.py create mode 100644 product_packaging_dimension/__manifest__.py create mode 100644 product_packaging_dimension/i18n/product_packaging_dimension.pot create mode 100644 product_packaging_dimension/models/__init__.py create mode 100644 product_packaging_dimension/models/product_packaging.py create mode 100644 product_packaging_dimension/readme/CONTRIBUTORS.rst create mode 100644 product_packaging_dimension/readme/DESCRIPTION.rst create mode 100644 product_packaging_dimension/readme/ROADMAP.rst create mode 100644 product_packaging_dimension/static/description/icon.png create mode 100644 product_packaging_dimension/static/description/index.html create mode 100644 product_packaging_dimension/views/product_packaging.xml diff --git a/product_packaging_dimension/README.rst b/product_packaging_dimension/README.rst new file mode 100644 index 000000000000..c751cd7f04bd --- /dev/null +++ b/product_packaging_dimension/README.rst @@ -0,0 +1,81 @@ +=========================== +Product Packaging Dimension +=========================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/12.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-12-0/product-attribute-12-0-product_packaging_dimension + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/135/12.0 + :alt: Try me on Runbot + +|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: + +Known issues / Roadmap +====================== + +* Resolve conflict with delivery module + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Patrick Tombez +* Akim Juillerat + +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..83357b4f6ab2 --- /dev/null +++ b/product_packaging_dimension/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2019 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': '12.0.1.0.0', + 'category': 'Product', + 'author': 'Camptocamp, Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'depends': [ + 'product', + ], + 'website': 'https://github.com/OCA/product-attribute', + 'data': [ + 'views/product_packaging.xml', + ], + 'installable': True, +} 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..80cdab0392f9 --- /dev/null +++ b/product_packaging_dimension/i18n/product_packaging_dimension.pot @@ -0,0 +1,65 @@ +# 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" +"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:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height (mm)" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__lngth +msgid "Length (mm)" +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,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume (m³)" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__max_weight +msgid "Weight (kg)" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width (mm)" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__height +msgid "height in millimeters" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__lngth +msgid "length in millimeters" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "volume in cubic meters" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__width +msgid "width in millimeters" +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..64c6973b28d1 --- /dev/null +++ b/product_packaging_dimension/models/product_packaging.py @@ -0,0 +1,28 @@ +# Copyright 2019-2020 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" + + max_weight = fields.Float("Weight (kg)") + # lngth IS NOT A TYPO https://github.com/odoo/odoo/issues/41353 + lngth = fields.Integer("Length (mm)", help="length in millimeters") + # Although it feels weird to use Integer in millimeters, we use Int to + # override the fields from delivery module instead of defining new ones + width = fields.Integer("Width (mm)", help="width in millimeters") + height = fields.Integer("Height (mm)", help="height in millimeters") + volume = fields.Float( + "Volume (m³)", + digits=(8, 4), + compute="_compute_volume", + readonly=True, + store=False, + help="volume in cubic meters", + ) + + @api.depends("lngth", "width", "height") + def _compute_volume(self): + for pack in self: + pack.volume = (pack.lngth * pack.width * pack.height) / 1000.0 ** 3 diff --git a/product_packaging_dimension/readme/CONTRIBUTORS.rst b/product_packaging_dimension/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..eafe874a259d --- /dev/null +++ b/product_packaging_dimension/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Patrick Tombez +* Akim Juillerat diff --git a/product_packaging_dimension/readme/DESCRIPTION.rst b/product_packaging_dimension/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..ceae3b3f7314 --- /dev/null +++ b/product_packaging_dimension/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module allows to store dimensions (length, width, height), weight and +volume of product packagings. + diff --git a/product_packaging_dimension/readme/ROADMAP.rst b/product_packaging_dimension/readme/ROADMAP.rst new file mode 100644 index 000000000000..07abef0a88f9 --- /dev/null +++ b/product_packaging_dimension/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Resolve conflict with delivery module diff --git a/product_packaging_dimension/static/description/icon.png b/product_packaging_dimension/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84Hm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E;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/product_packaging_dimension/static/description/index.html b/product_packaging_dimension/static/description/index.html new file mode 100644 index 000000000000..19ccc077fd5c --- /dev/null +++ b/product_packaging_dimension/static/description/index.html @@ -0,0 +1,428 @@ + + + + + + +Product Packaging Dimension + + + +
+

Product Packaging Dimension

+ + +

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

+

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

+

Table of contents

+ +
+

Known issues / Roadmap

+
    +
  • Resolve conflict with delivery module
  • +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • 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_packaging_dimension/views/product_packaging.xml b/product_packaging_dimension/views/product_packaging.xml new file mode 100644 index 000000000000..4fc776f7fb53 --- /dev/null +++ b/product_packaging_dimension/views/product_packaging.xml @@ -0,0 +1,19 @@ + + + + product.packaging.form.view.inherit + product.packaging + + + + + + + + + + + + + + From 6249bdd9233b3080d5bda1d0677bc157d3163911 Mon Sep 17 00:00:00 2001 From: claudiagn Date: Mon, 15 Feb 2021 16:31:59 +0000 Subject: [PATCH 02/22] Added translation using Weblate (Spanish) --- product_packaging_dimension/i18n/es.po | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 product_packaging_dimension/i18n/es.po diff --git a/product_packaging_dimension/i18n/es.po b/product_packaging_dimension/i18n/es.po new file mode 100644 index 000000000000..222514a5563c --- /dev/null +++ b/product_packaging_dimension/i18n/es.po @@ -0,0 +1,67 @@ +# 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: 2021-02-15 17:45+0000\n" +"Last-Translator: claudiagn \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.3.2\n" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height (mm)" +msgstr "Altura (mm)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__lngth +msgid "Length (mm)" +msgstr "Longitud(mm)" + +#. 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,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume (m³)" +msgstr "Volumen(m³)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__max_weight +msgid "Weight (kg)" +msgstr "Peso (kg)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width (mm)" +msgstr "Amplitud (mm)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__height +msgid "height in millimeters" +msgstr "altura en milímetros" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__lngth +msgid "length in millimeters" +msgstr "longitud en milímetros" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "volume in cubic meters" +msgstr "volumen en metros cúbicos" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__width +msgid "width in millimeters" +msgstr "amplitud en milímetros" From f63aa27346228ebea3be4a19b00dfb7891c95241 Mon Sep 17 00:00:00 2001 From: claudiagn Date: Tue, 16 Feb 2021 16:08:59 +0000 Subject: [PATCH 03/22] Added translation using Weblate (Catalan) --- product_packaging_dimension/i18n/ca.po | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 product_packaging_dimension/i18n/ca.po diff --git a/product_packaging_dimension/i18n/ca.po b/product_packaging_dimension/i18n/ca.po new file mode 100644 index 000000000000..884528c4ac4d --- /dev/null +++ b/product_packaging_dimension/i18n/ca.po @@ -0,0 +1,67 @@ +# 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: 2021-02-16 18:45+0000\n" +"Last-Translator: claudiagn \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:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height +msgid "Height (mm)" +msgstr "Alçacada (mm)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__lngth +msgid "Length (mm)" +msgstr "Longitud (mm)" + +#. 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,field_description:product_packaging_dimension.field_product_packaging__volume +msgid "Volume (m³)" +msgstr "Volum (m³)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__max_weight +msgid "Weight (kg)" +msgstr "Pes (kg)" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width +msgid "Width (mm)" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__height +msgid "height in millimeters" +msgstr "alçada en milímetres" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__lngth +msgid "length in millimeters" +msgstr "longitud en milímetres" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__volume +msgid "volume in cubic meters" +msgstr "volum en metres cúbics" + +#. module: product_packaging_dimension +#: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__width +msgid "width in millimeters" +msgstr "amplada en milímetres" From 587d70de84729dcd6e44233e6c3ae89d1ffa436d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Roche?= Date: Sun, 25 Apr 2021 15:48:21 +0200 Subject: [PATCH 04/22] [IMP] product_packaging_dimension: black, isort, prettier --- product_packaging_dimension/__manifest__.py | 24 +++++++++---------- .../readme/DESCRIPTION.rst | 1 - .../views/product_packaging.xml | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/product_packaging_dimension/__manifest__.py b/product_packaging_dimension/__manifest__.py index 83357b4f6ab2..197fc68312c1 100644 --- a/product_packaging_dimension/__manifest__.py +++ b/product_packaging_dimension/__manifest__.py @@ -1,18 +1,18 @@ # Copyright 2019 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': '12.0.1.0.0', - 'category': 'Product', - 'author': 'Camptocamp, Odoo Community Association (OCA)', - 'license': 'AGPL-3', - 'depends': [ - 'product', + "name": "Product Packaging Dimension", + "summary": "Manage packaging dimensions and weight", + "version": "14.0.1.0.0", + "category": "Product", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "product", ], - 'website': 'https://github.com/OCA/product-attribute', - 'data': [ - 'views/product_packaging.xml', + "website": "https://github.com/OCA/product-attribute", + "data": [ + "views/product_packaging.xml", ], - 'installable': True, + "installable": True, } diff --git a/product_packaging_dimension/readme/DESCRIPTION.rst b/product_packaging_dimension/readme/DESCRIPTION.rst index ceae3b3f7314..a59a6549a271 100644 --- a/product_packaging_dimension/readme/DESCRIPTION.rst +++ b/product_packaging_dimension/readme/DESCRIPTION.rst @@ -1,3 +1,2 @@ This module allows to store dimensions (length, width, height), weight and volume of product packagings. - diff --git a/product_packaging_dimension/views/product_packaging.xml b/product_packaging_dimension/views/product_packaging.xml index 4fc776f7fb53..ae82b40f0bca 100644 --- a/product_packaging_dimension/views/product_packaging.xml +++ b/product_packaging_dimension/views/product_packaging.xml @@ -1,4 +1,4 @@ - + product.packaging.form.view.inherit From faac7ecdfdeb50679e2da6f30ed371adea11c136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Roche?= Date: Sun, 25 Apr 2021 22:37:54 +0200 Subject: [PATCH 05/22] [MIG] product_packaging_dimension: Migration to 14.0 --- product_packaging_dimension/README.rst | 13 +- product_packaging_dimension/__manifest__.py | 5 +- .../i18n/product_packaging_dimension.pot | 118 +++++++++++++--- .../migrations/14.0.1.0.0/pre-migrate.py | 22 +++ .../models/product_packaging.py | 128 ++++++++++++++++-- .../readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 8 +- product_packaging_dimension/tests/__init__.py | 2 + .../tests/test_packaging_volume.py | 107 +++++++++++++++ .../views/product_packaging.xml | 42 +++++- 10 files changed, 398 insertions(+), 48 deletions(-) create mode 100644 product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py create mode 100644 product_packaging_dimension/tests/__init__.py create mode 100644 product_packaging_dimension/tests/test_packaging_volume.py diff --git a/product_packaging_dimension/README.rst b/product_packaging_dimension/README.rst index c751cd7f04bd..79eb1eb125a9 100644 --- a/product_packaging_dimension/README.rst +++ b/product_packaging_dimension/README.rst @@ -14,13 +14,13 @@ Product Packaging Dimension :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/12.0/product_packaging_dimension + :target: https://github.com/OCA/product-attribute/tree/14.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-12-0/product-attribute-12-0-product_packaging_dimension + :target: https://translation.odoo-community.org/projects/product-attribute-14-0/product-attribute-14-0-product_packaging_dimension :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/135/12.0 + :target: https://runbot.odoo-community.org/runbot/135/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -28,7 +28,6 @@ Product Packaging Dimension This module allows to store dimensions (length, width, height), weight and volume of product packagings. - **Table of contents** .. contents:: @@ -45,7 +44,7 @@ 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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -56,12 +55,14 @@ Authors ~~~~~~~ * Camptocamp +* Akretion Contributors ~~~~~~~~~~~~ * Patrick Tombez * Akim Juillerat +* Kévin Roche Maintainers ~~~~~~~~~~~ @@ -76,6 +77,6 @@ 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. +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/__manifest__.py b/product_packaging_dimension/__manifest__.py index 197fc68312c1..b3a8aacdc6ed 100644 --- a/product_packaging_dimension/__manifest__.py +++ b/product_packaging_dimension/__manifest__.py @@ -1,14 +1,15 @@ -# Copyright 2019 Camptocamp SA +# 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": "14.0.1.0.0", "category": "Product", - "author": "Camptocamp, Odoo Community Association (OCA)", + "author": "Camptocamp, Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", "depends": [ "product", + "product_logistics_uom", ], "website": "https://github.com/OCA/product-attribute", "data": [ diff --git a/product_packaging_dimension/i18n/product_packaging_dimension.pot b/product_packaging_dimension/i18n/product_packaging_dimension.pot index 80cdab0392f9..47de5f073499 100644 --- a/product_packaging_dimension/i18n/product_packaging_dimension.pot +++ b/product_packaging_dimension/i18n/product_packaging_dimension.pot @@ -1,26 +1,81 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * product_packaging_dimension +# * product_packaging_dimension # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\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__display_name +msgid "Display Name" +msgstr "" + #. module: product_packaging_dimension #: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height -msgid "Height (mm)" +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__id +msgid "ID" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging____last_update +msgid "Last Modified on" +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,field_description:product_packaging_dimension.field_product_packaging__lngth -msgid "Length (mm)" +#: model:ir.model.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_max_weight +msgid "Max Weight must be positive" +msgstr "" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__max_weight +msgid "Maximum Weight" +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 @@ -28,38 +83,63 @@ msgstr "" 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 (m³)" +msgid "Volume" msgstr "" #. module: product_packaging_dimension -#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__max_weight -msgid "Weight (kg)" +#: 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__width -msgid "Width (mm)" +#: 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,help:product_packaging_dimension.field_product_packaging__height -msgid "height in millimeters" +#: 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__lngth -msgid "length in millimeters" +#: 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,help:product_packaging_dimension.field_product_packaging__volume -msgid "volume in cubic meters" +#: 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.fields,help:product_packaging_dimension.field_product_packaging__width -msgid "width in millimeters" +#: 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/migrations/14.0.1.0.0/pre-migrate.py b/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py new file mode 100644 index 000000000000..aa1de7a1c175 --- /dev/null +++ b/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py @@ -0,0 +1,22 @@ +# Copyright 2021 Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tools.sql import column_exists, rename_column + + +def migrate(cr, version): + # Rename lnght into packaging_length + if column_exists(cr, "product_packaging", "lnght"): + rename_column(cr, "product_packaging", "lnght", "packaging_length") + + # Convert old hard-coded uom values (mm) + # into new default uom values (m) + cr.execute( + """ + UPDATE product_packaging + SET + packaging_length = packaging_length/1000, + height = height/1000, + width = width/1000, + """ + ) diff --git a/product_packaging_dimension/models/product_packaging.py b/product_packaging_dimension/models/product_packaging.py index 64c6973b28d1..12384868e644 100644 --- a/product_packaging_dimension/models/product_packaging.py +++ b/product_packaging_dimension/models/product_packaging.py @@ -1,28 +1,130 @@ -# Copyright 2019-2020 Camptocamp SA +# 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.0)", "Height must be positive"), + ("positive_width", "CHECK(width>=0.0)", "Width must be positive"), + ("positive_length", "CHECK(packaging_length>=0.0)", "Length must be positive"), + ( + "positive_max_weight", + "CHECK(max_weight>=0.0)", + "Max Weight must be positive", + ), + ] + height = fields.Float("Height") + width = fields.Float("Width") + packaging_length = fields.Float("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", + readonly=True, + ) + + weight = fields.Float("Weight") + max_weight = fields.Float("Maximum Weight") + 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", + compute=False, + 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", + readonly=True, + ) - max_weight = fields.Float("Weight (kg)") - # lngth IS NOT A TYPO https://github.com/odoo/odoo/issues/41353 - lngth = fields.Integer("Length (mm)", help="length in millimeters") - # Although it feels weird to use Integer in millimeters, we use Int to - # override the fields from delivery module instead of defining new ones - width = fields.Integer("Width (mm)", help="width in millimeters") - height = fields.Integer("Height (mm)", help="height in millimeters") volume = fields.Float( - "Volume (m³)", + "Volume", digits=(8, 4), compute="_compute_volume", readonly=True, store=False, - help="volume in cubic meters", + help="The Packaging volume", ) - @api.depends("lngth", "width", "height") + 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", + readonly=True, + ) + + @api.depends( + "packaging_length", "width", "height", "length_uom_id", "volume_uom_id" + ) def _compute_volume(self): - for pack in self: - pack.volume = (pack.lngth * pack.width * pack.height) / 1000.0 ** 3 + 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/readme/CONTRIBUTORS.rst b/product_packaging_dimension/readme/CONTRIBUTORS.rst index eafe874a259d..409a54ad273b 100644 --- a/product_packaging_dimension/readme/CONTRIBUTORS.rst +++ b/product_packaging_dimension/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Patrick Tombez * Akim Juillerat +* Kévin Roche diff --git a/product_packaging_dimension/static/description/index.html b/product_packaging_dimension/static/description/index.html index 19ccc077fd5c..b65f991cb6dd 100644 --- a/product_packaging_dimension/static/description/index.html +++ b/product_packaging_dimension/static/description/index.html @@ -367,7 +367,7 @@

Product Packaging Dimension

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

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

Table of contents

@@ -394,7 +394,7 @@

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 smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -403,6 +403,7 @@

Credits

Authors

  • Camptocamp
  • +
  • Akretion
@@ -410,6 +411,7 @@

Contributors

@@ -419,7 +421,7 @@

Maintainers

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.

+

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..50340afff35c --- /dev/null +++ b/product_packaging_dimension/tests/test_packaging_volume.py @@ -0,0 +1,107 @@ +# 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): + def setUp(self): + super(TestPackagingVolumeCompute, self).setUp() + + 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.0 + self.packaging.width = 10.8 + self.packaging.length_uom_id = self.uom_m + self.packaging.volume_uom_id = self.uom_m3 + self.packaging._compute_volume() + self.assertEqual(864, self.packaging.volume) + + self.packaging2.packaging_length = 6.0 + self.packaging2.height = 14.0 + self.packaging2.width = 1.2 + self.packaging2.length_uom_id = self.uom_m + self.packaging2.volume_uom_id = self.uom_m3 + self.packaging2._compute_volume() + self.assertAlmostEqual(100.8, self.packaging2.volume) + + self.packaging3.packaging_length = 100.0 + self.packaging3.height = 50.5 + self.packaging3.width = 80.0 + self.packaging3.length_uom_id = self.uom_m + self.packaging3.volume_uom_id = self.uom_m3 + self.packaging3._compute_volume() + self.assertEqual(404000, 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 index ae82b40f0bca..98dcc210c42c 100644 --- a/product_packaging_dimension/views/product_packaging.xml +++ b/product_packaging_dimension/views/product_packaging.xml @@ -6,12 +6,44 @@ - - - - + + + + + + + + From ea53674bf9d98115380a5cacc90074579aaea83c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 14 Sep 2021 11:44:20 +0000 Subject: [PATCH 06/22] product_packaging_dimension 14.0.1.0.1 --- product_packaging_dimension/__manifest__.py | 2 +- .../migrations/14.0.1.0.0/pre-migrate.py | 19 +++++-------------- .../models/product_packaging.py | 14 +++++++------- .../tests/test_packaging_volume.py | 16 ++++++++-------- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/product_packaging_dimension/__manifest__.py b/product_packaging_dimension/__manifest__.py index b3a8aacdc6ed..a743956bc2f9 100644 --- a/product_packaging_dimension/__manifest__.py +++ b/product_packaging_dimension/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Product Packaging Dimension", "summary": "Manage packaging dimensions and weight", - "version": "14.0.1.0.0", + "version": "14.0.1.0.1", "category": "Product", "author": "Camptocamp, Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py b/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py index aa1de7a1c175..b1c282b3da7e 100644 --- a/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py +++ b/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py @@ -5,18 +5,9 @@ def migrate(cr, version): - # Rename lnght into packaging_length - if column_exists(cr, "product_packaging", "lnght"): - rename_column(cr, "product_packaging", "lnght", "packaging_length") - # Convert old hard-coded uom values (mm) - # into new default uom values (m) - cr.execute( - """ - UPDATE product_packaging - SET - packaging_length = packaging_length/1000, - height = height/1000, - width = width/1000, - """ - ) + # Rename lngth into packaging_length + if column_exists(cr, "product_packaging", "packaging_length"): + cr.execute("UPDATE product_packaging SET packaging_length = lngth") + elif column_exists(cr, "product_packaging", "lngth"): + rename_column(cr, "product_packaging", "lngth", "packaging_length") diff --git a/product_packaging_dimension/models/product_packaging.py b/product_packaging_dimension/models/product_packaging.py index 12384868e644..42f64fb23bc8 100644 --- a/product_packaging_dimension/models/product_packaging.py +++ b/product_packaging_dimension/models/product_packaging.py @@ -10,18 +10,18 @@ class ProductPackaging(models.Model): # The redundancy here avoids unnecessary dependencies on sale modules. _sql_constraints = [ - ("positive_height", "CHECK(height>=0.0)", "Height must be positive"), - ("positive_width", "CHECK(width>=0.0)", "Width must be positive"), - ("positive_length", "CHECK(packaging_length>=0.0)", "Length must be positive"), + ("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_max_weight", - "CHECK(max_weight>=0.0)", + "CHECK(max_weight>=0)", "Max Weight must be positive", ), ] - height = fields.Float("Height") - width = fields.Float("Width") - packaging_length = fields.Float("Length") + height = fields.Integer("Height") + width = fields.Integer("Width") + packaging_length = fields.Integer("Length") length_uom_id = fields.Many2one( "uom.uom", diff --git a/product_packaging_dimension/tests/test_packaging_volume.py b/product_packaging_dimension/tests/test_packaging_volume.py index 50340afff35c..4a1d5c780305 100644 --- a/product_packaging_dimension/tests/test_packaging_volume.py +++ b/product_packaging_dimension/tests/test_packaging_volume.py @@ -53,28 +53,28 @@ 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.0 - self.packaging.width = 10.8 + 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(864, self.packaging.volume) + self.assertEqual(800, self.packaging.volume) self.packaging2.packaging_length = 6.0 self.packaging2.height = 14.0 - self.packaging2.width = 1.2 + 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.assertAlmostEqual(100.8, self.packaging2.volume) + self.assertEqual(84.0, self.packaging2.volume) self.packaging3.packaging_length = 100.0 - self.packaging3.height = 50.5 - self.packaging3.width = 80.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(404000, self.packaging3.volume) + self.assertEqual(400000, self.packaging3.volume) def test_output_uom(self): # Tests with both different initial and volume UoMs. From ff9e51b40a3ef90e736faaff8d0f0241844d29c3 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 21 Jan 2022 10:37:51 +0000 Subject: [PATCH 07/22] product_packaging_dimension 14.0.1.0.2 --- product_packaging_dimension/__manifest__.py | 2 +- product_packaging_dimension/i18n/ca.po | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/product_packaging_dimension/__manifest__.py b/product_packaging_dimension/__manifest__.py index a743956bc2f9..a91af8a1d66c 100644 --- a/product_packaging_dimension/__manifest__.py +++ b/product_packaging_dimension/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Product Packaging Dimension", "summary": "Manage packaging dimensions and weight", - "version": "14.0.1.0.1", + "version": "14.0.1.0.2", "category": "Product", "author": "Camptocamp, Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/product_packaging_dimension/i18n/ca.po b/product_packaging_dimension/i18n/ca.po index 884528c4ac4d..d541e3410a75 100644 --- a/product_packaging_dimension/i18n/ca.po +++ b/product_packaging_dimension/i18n/ca.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-02-16 18:45+0000\n" -"Last-Translator: claudiagn \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" @@ -44,7 +44,7 @@ msgstr "Pes (kg)" #. module: product_packaging_dimension #: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__width msgid "Width (mm)" -msgstr "" +msgstr "Amplada (mm)" #. module: product_packaging_dimension #: model:ir.model.fields,help:product_packaging_dimension.field_product_packaging__height From 77df6c95bcb026b0ec23b60ab9e9b9c57783617a Mon Sep 17 00:00:00 2001 From: Fernando La Chica Date: Thu, 29 Sep 2022 09:24:39 +0200 Subject: [PATCH 08/22] [MIG] product_packaging_dimension: 15.0 --- product_packaging_dimension/__manifest__.py | 2 +- .../migrations/14.0.1.0.0/pre-migrate.py | 13 ------------- .../models/product_packaging.py | 9 ++++----- product_packaging_dimension/readme/CONTRIBUTORS.rst | 1 + 4 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py diff --git a/product_packaging_dimension/__manifest__.py b/product_packaging_dimension/__manifest__.py index a91af8a1d66c..be25639ac0c1 100644 --- a/product_packaging_dimension/__manifest__.py +++ b/product_packaging_dimension/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Product Packaging Dimension", "summary": "Manage packaging dimensions and weight", - "version": "14.0.1.0.2", + "version": "15.0.1.0.0", "category": "Product", "author": "Camptocamp, Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py b/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py deleted file mode 100644 index b1c282b3da7e..000000000000 --- a/product_packaging_dimension/migrations/14.0.1.0.0/pre-migrate.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2021 Akretion -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo.tools.sql import column_exists, rename_column - - -def migrate(cr, version): - - # Rename lngth into packaging_length - if column_exists(cr, "product_packaging", "packaging_length"): - cr.execute("UPDATE product_packaging SET packaging_length = lngth") - elif column_exists(cr, "product_packaging", "lngth"): - rename_column(cr, "product_packaging", "lngth", "packaging_length") diff --git a/product_packaging_dimension/models/product_packaging.py b/product_packaging_dimension/models/product_packaging.py index 42f64fb23bc8..e248f1173b1a 100644 --- a/product_packaging_dimension/models/product_packaging.py +++ b/product_packaging_dimension/models/product_packaging.py @@ -19,9 +19,9 @@ class ProductPackaging(models.Model): "Max Weight must be positive", ), ] - height = fields.Integer("Height") - width = fields.Integer("Width") - packaging_length = fields.Integer("Length") + height = fields.Integer() + width = fields.Integer() + packaging_length = fields.Integer() length_uom_id = fields.Many2one( "uom.uom", @@ -40,7 +40,7 @@ class ProductPackaging(models.Model): readonly=True, ) - weight = fields.Float("Weight") + weight = fields.Float() max_weight = fields.Float("Maximum Weight") weight_uom_id = fields.Many2one( "uom.uom", @@ -62,7 +62,6 @@ class ProductPackaging(models.Model): ) volume = fields.Float( - "Volume", digits=(8, 4), compute="_compute_volume", readonly=True, diff --git a/product_packaging_dimension/readme/CONTRIBUTORS.rst b/product_packaging_dimension/readme/CONTRIBUTORS.rst index 409a54ad273b..e8de7e6a166e 100644 --- a/product_packaging_dimension/readme/CONTRIBUTORS.rst +++ b/product_packaging_dimension/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ * Patrick Tombez * Akim Juillerat * Kévin Roche +* Fernando La Chica From 192e700674f4f5e268155c1a4bce050e4496cd32 Mon Sep 17 00:00:00 2001 From: mle Date: Fri, 7 Oct 2022 10:24:54 +0200 Subject: [PATCH 09/22] [MIG] product_packaging_dimension: Migration to 16.0 --- product_packaging_dimension/README.rst | 11 ++++---- product_packaging_dimension/__manifest__.py | 2 +- .../i18n/product_packaging_dimension.pot | 27 +++++-------------- .../static/description/index.html | 7 ++--- 4 files changed, 17 insertions(+), 30 deletions(-) diff --git a/product_packaging_dimension/README.rst b/product_packaging_dimension/README.rst index 79eb1eb125a9..2c723723845e 100644 --- a/product_packaging_dimension/README.rst +++ b/product_packaging_dimension/README.rst @@ -14,13 +14,13 @@ Product Packaging Dimension :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/14.0/product_packaging_dimension + :target: https://github.com/OCA/product-attribute/tree/16.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-14-0/product-attribute-14-0-product_packaging_dimension + :target: https://translation.odoo-community.org/projects/product-attribute-16-0/product-attribute-16-0-product_packaging_dimension :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/135/14.0 + :target: https://runbot.odoo-community.org/runbot/135/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -44,7 +44,7 @@ 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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -63,6 +63,7 @@ Contributors * Patrick Tombez * Akim Juillerat * Kévin Roche +* Fernando La Chica Maintainers ~~~~~~~~~~~ @@ -77,6 +78,6 @@ 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. +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/__manifest__.py b/product_packaging_dimension/__manifest__.py index be25639ac0c1..c5bc3ebc9550 100644 --- a/product_packaging_dimension/__manifest__.py +++ b/product_packaging_dimension/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Product Packaging Dimension", "summary": "Manage packaging dimensions and weight", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Product", "author": "Camptocamp, Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", diff --git a/product_packaging_dimension/i18n/product_packaging_dimension.pot b/product_packaging_dimension/i18n/product_packaging_dimension.pot index 47de5f073499..35cfaf6a7286 100644 --- a/product_packaging_dimension/i18n/product_packaging_dimension.pot +++ b/product_packaging_dimension/i18n/product_packaging_dimension.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -23,11 +23,6 @@ msgstr "" msgid "Dimensions Units of Measure" msgstr "" -#. module: product_packaging_dimension -#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__display_name -msgid "Display Name" -msgstr "" - #. module: product_packaging_dimension #: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__height msgid "Height" @@ -38,21 +33,6 @@ msgstr "" msgid "Height must be positive" msgstr "" -#. module: product_packaging_dimension -#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__id -msgid "ID" -msgstr "" - -#. module: product_packaging_dimension -#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging____last_update -msgid "Last Modified on" -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" @@ -73,6 +53,11 @@ msgstr "" msgid "Maximum Weight" msgstr "" +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__packaging_length +msgid "Packaging Length" +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" diff --git a/product_packaging_dimension/static/description/index.html b/product_packaging_dimension/static/description/index.html index b65f991cb6dd..41ce44fa69ef 100644 --- a/product_packaging_dimension/static/description/index.html +++ b/product_packaging_dimension/static/description/index.html @@ -367,7 +367,7 @@

Product Packaging Dimension

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

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

Table of contents

@@ -394,7 +394,7 @@

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 smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -412,6 +412,7 @@

Contributors

  • Patrick Tombez <patrick.tombez@camptocamp.com>
  • Akim Juillerat <akim.juillerat@camptocamp.com>
  • Kévin Roche <kevin.roche@akretion.com>
  • +
  • Fernando La Chica <fernandolachica@gmail.com>
  • @@ -421,7 +422,7 @@

    Maintainers

    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.

    +

    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.

    From 094f8dd10d1dcb729ae060b41d97f3ed84831bdd Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 25 Oct 2022 09:53:44 +0000 Subject: [PATCH 10/22] product_packaging_dimension 16.0.1.0.1 --- product_packaging_dimension/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_packaging_dimension/__manifest__.py b/product_packaging_dimension/__manifest__.py index c5bc3ebc9550..d641cbf28c96 100644 --- a/product_packaging_dimension/__manifest__.py +++ b/product_packaging_dimension/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Product Packaging Dimension", "summary": "Manage packaging dimensions and weight", - "version": "16.0.1.0.0", + "version": "16.0.1.0.1", "category": "Product", "author": "Camptocamp, Akretion, Odoo Community Association (OCA)", "license": "AGPL-3", From 956bd176a3d7fa23b95532cf6793f0fb1f834392 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Fri, 4 Nov 2022 12:14:42 +0000 Subject: [PATCH 11/22] Added translation using Weblate (German) --- product_packaging_dimension/README.rst | 1 + product_packaging_dimension/i18n/de.po | 135 ++++++++++++++++++ .../readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 3 +- .../views/product_packaging.xml | 36 +++-- 5 files changed, 163 insertions(+), 13 deletions(-) create mode 100644 product_packaging_dimension/i18n/de.po diff --git a/product_packaging_dimension/README.rst b/product_packaging_dimension/README.rst index 2c723723845e..223169e62b07 100644 --- a/product_packaging_dimension/README.rst +++ b/product_packaging_dimension/README.rst @@ -64,6 +64,7 @@ Contributors * Akim Juillerat * Kévin Roche * Fernando La Chica +* Denis Roussel Maintainers ~~~~~~~~~~~ diff --git a/product_packaging_dimension/i18n/de.po b/product_packaging_dimension/i18n/de.po new file mode 100644 index 000000000000..e036151a1c34 --- /dev/null +++ b/product_packaging_dimension/i18n/de.po @@ -0,0 +1,135 @@ +# 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.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.constraint,message:product_packaging_dimension.constraint_product_packaging_positive_max_weight +msgid "Max Weight must be positive" +msgstr "Das maximale Gewicht muss positiv sein." + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__max_weight +msgid "Maximum Weight" +msgstr "Max. Gewicht" + +#. module: product_packaging_dimension +#: model:ir.model.fields,field_description:product_packaging_dimension.field_product_packaging__packaging_length +msgid "Packaging Length" +msgstr "Länge (Verpackung)" + +#. 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.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." diff --git a/product_packaging_dimension/readme/CONTRIBUTORS.rst b/product_packaging_dimension/readme/CONTRIBUTORS.rst index e8de7e6a166e..02e7277fb988 100644 --- a/product_packaging_dimension/readme/CONTRIBUTORS.rst +++ b/product_packaging_dimension/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Akim Juillerat * Kévin Roche * Fernando La Chica +* Denis Roussel diff --git a/product_packaging_dimension/static/description/index.html b/product_packaging_dimension/static/description/index.html index 41ce44fa69ef..90ce084ac905 100644 --- a/product_packaging_dimension/static/description/index.html +++ b/product_packaging_dimension/static/description/index.html @@ -3,7 +3,7 @@ - + Product Packaging Dimension