From 2df68915d874abaad2fc3f7aac9aa8173d549020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 20 Aug 2023 12:49:38 +0200 Subject: [PATCH] Remove quantity UoM digits on stock location --- modules/stock/location.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/stock/location.py b/modules/stock/location.py index 37757bb434..b62b7c01f7 100644 --- a/modules/stock/location.py +++ b/modules/stock/location.py @@ -162,21 +162,18 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView): quantity = fields.Function( fields.Float( - "Quantity", digits=(16, Eval('quantity_uom_digits', 2)), + "Quantity", digits='quantity_uom', help="The amount of stock in the location."), 'get_quantity', searcher='search_quantity') forecast_quantity = fields.Function( fields.Float( - "Forecast Quantity", digits=(16, Eval('quantity_uom_digits', 2)), + "Forecast Quantity", digits='quantity_uom', help="The amount of stock expected to be in the location."), 'get_quantity', searcher='search_quantity') quantity_uom = fields.Function(fields.Many2One( 'product.uom', "Quantity UoM", help="The Unit of Measure for the quantities."), 'get_quantity_uom') - quantity_uom_digits = fields.Function(fields.Integer( - "Quantity UoM Digits"), - 'get_quantity_uom') cost_value = fields.Function(fields.Numeric( "Cost Value", digits=price_digits, help="The value of the stock in the location."), @@ -473,10 +470,7 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView): template = Template(context['product_template']) uom = template.default_uom if uom: - if name == 'quantity_uom': - value = uom.id - elif name == 'quantity_uom_digits': - value = uom.digits + value = uom.id return {l.id: value for l in locations} @classmethod