From 52a85e57b9a6353c14abdbcd7e04d34214f151f5 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Mon, 8 Jan 2018 16:25:09 +0100 Subject: [PATCH] [IMP] stock: configurable product's weight UOM This commit adds the possibility to chose between pounds and kilograms to express the weight field on the product. This is done so that companies that worked internally in pounds do not have to convert their weights back to kilograms for a consistent computation of the rates in delivery. We complete the general settings with the selection of the weight's uom. Validating the setting will create an ir.config.parameter. A static method defined on product template will return the chosen UOM. We display "weight_uom_name" on the form view so that the UOM is not clickable/editable because we fear user would want to edit the UOM instead of changing it in the res config. We move the view definition allowing to fill the product's weight from stock to product to help the generation of the intrastat report without installing inventory. --- .../views/res_config_settings_views.xml | 58 ++++++++++--------- addons/delivery/models/stock_picking.py | 13 ++--- addons/product/models/product.py | 2 +- addons/product/models/product_template.py | 21 +++++++ addons/product/models/res_config_settings.py | 4 ++ addons/product/views/product_views.xml | 12 ++++ .../views/res_config_settings_views.xml | 20 +++++++ addons/stock/views/product_views.xml | 12 ---- 8 files changed, 94 insertions(+), 48 deletions(-) diff --git a/addons/base_setup/views/res_config_settings_views.xml b/addons/base_setup/views/res_config_settings_views.xml index a58f3e0d808..f10dd6244e2 100644 --- a/addons/base_setup/views/res_config_settings_views.xml +++ b/addons/base_setup/views/res_config_settings_views.xml @@ -79,40 +79,42 @@ - -

Multi-company

-
-
-
- -
-
-