From 9f8eae34d1d89d7cf01eef8a1a89dc431ef5f4e2 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 19 Jul 2018 13:35:27 +0200 Subject: [FIX] undefined variables (potential nameerror) Backport 9ec0455abc041b855dcab18e8e185baf806b9f14 and 6a601fe6dc848cdeca2ab8429210e3b5087275d9 as they fixed various possible NameError but did so in later sub-releases. --- odoo/tools/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odoo/tools/misc.py') diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index 2f43c58e02d..17518ce1525 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -1069,7 +1069,7 @@ def formatLang(env, value, digits=None, grouping=True, monetary=False, dp=False, digits = decimal_precision_obj.precision_get(dp) elif currency_obj: digits = currency_obj.decimal_places - elif (hasattr(value, '_field') and isinstance(value._field, (float_field, function_field)) and value._field.digits): + elif (hasattr(value, '_field') and getattr(value._field, 'digits', None)): digits = value._field.digits[1] if not digits and digits is not 0: digits = DEFAULT_DIGITS -- cgit v1.2.3