From c7d0f18fcf297d5003890d1dea590cf61ab5e369 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Mon, 2 Mar 2015 17:58:51 +0100 Subject: [PATCH] [IMP] respect product decimal precision https://github.com/odoo/odoo/issues/5512 and https://github.com/odoo-dev/odoo/commit/b3e5a940e3b67021173d07eb0c71c981a2fb9c78 makes it clear the standard intends to support decimal precision on the product form. --- stock_available/product.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stock_available/product.py b/stock_available/product.py index 08a8aa277..1a3b72a59 100644 --- a/stock_available/product.py +++ b/stock_available/product.py @@ -19,7 +19,7 @@ ############################################################################## from openerp import models, fields, api -#from openerp.addons import decimal_precision as dp +from openerp.addons import decimal_precision as dp class ProductTemplate(models.Model): @@ -42,11 +42,10 @@ class ProductTemplate(models.Model): product.immediately_usable_qty = product.virtual_available immediately_usable_qty = fields.Float( + digits=dp.get_precision('Product Unit of Measure'), compute='_product_available', string='Available to promise', help="Stock for this Product that can be safely proposed " "for sale to Customers.\n" "The definition of this value can be configured to suit " "your needs") - # XXX the standard doesn't honor the UoM decimal precision. Should we? - # digits=dp.get_precision('Product Unit of Measure'),