From acd67ab477dd61a0b54e0ae39ba172f3a4dfc334 Mon Sep 17 00:00:00 2001 From: Pratima Gupta Date: Mon, 11 Jan 2021 07:09:31 +0000 Subject: [PATCH] [IMP] uom: added mm uom for length of product package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed the uom of product package if product_length_in_feet_param of ir config parameter for product is not 1. Previously its value was meter. For following fields updated the uom - 1) packaging_length 2) width 3) height closes odoo/odoo#64735 Taskid: 2418421 Related: odoo/upgrade#2089 Related: odoo/enterprise#15848 Signed-off-by: Rémy Voet --- addons/product/models/product_template.py | 4 ++-- addons/uom/data/uom_data.xml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py index 128a129ae2a..c0a3f8f2f7f 100644 --- a/addons/product/models/product_template.py +++ b/addons/product/models/product_template.py @@ -291,7 +291,7 @@ class ProductTemplate(models.Model): @api.model def _get_length_uom_id_from_ir_config_parameter(self): """ Get the unit of measure to interpret the `length`, 'width', 'height' field. - By default, we considerer that length are expressed in meters. Users can configure + By default, we considerer that length are expressed in millimeters. Users can configure to express them in feet by adding an ir.config_parameter record with "product.volume_in_cubic_feet" as key and "1" as value. """ @@ -299,7 +299,7 @@ class ProductTemplate(models.Model): if product_length_in_feet_param == '1': return self.env.ref('uom.product_uom_foot') else: - return self.env.ref('uom.product_uom_meter') + return self.env.ref('uom.product_uom_millimeter') @api.model def _get_volume_uom_id_from_ir_config_parameter(self): diff --git a/addons/uom/data/uom_data.xml b/addons/uom/data/uom_data.xml index 1129dfd3179..4c5cd00bd87 100644 --- a/addons/uom/data/uom_data.xml +++ b/addons/uom/data/uom_data.xml @@ -55,6 +55,12 @@ reference + + + mm + + smaller + km