diff --git a/trytond/CHANGELOG b/trytond/CHANGELOG index b4223c0d4c..425ac608e1 100644 --- a/trytond/CHANGELOG +++ b/trytond/CHANGELOG @@ -1,3 +1,4 @@ +* Set Decimal precision of default context from TRYTOND_DECIMAL_PREC * Replace usage of docstring of Model by __string__ attribute * Rename ir.model.field 'field_description' into 'string' * Replace docstring of models by __string__ diff --git a/trytond/trytond/__init__.py b/trytond/trytond/__init__.py index 2153bfeb82..71e2ef3dee 100644 --- a/trytond/trytond/__init__.py +++ b/trytond/trytond/__init__.py @@ -1,5 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. + +import decimal import os import time import warnings @@ -40,3 +42,5 @@ def default_user_agent(name="Tryton"): if requests_utils: requests_utils.default_user_agent = default_user_agent + +decimal.DefaultContext.prec = int(os.environ.get('TRYTOND_DECIMAL_PREC', 28)) diff --git a/trytond/trytond/commandline.py b/trytond/trytond/commandline.py index f273b9fbbe..99b4d556a5 100644 --- a/trytond/trytond/commandline.py +++ b/trytond/trytond/commandline.py @@ -65,6 +65,9 @@ def get_parser(): parser.add_argument( "--logconf", dest="logconf", default=logging_config, metavar='FILE', help="set logging configuration file (ConfigParser format)") + parser.epilog = ( + "The default Decimal precision can be specified in the " + "TRYTOND_DECIMAL_PREC environment variable.") return parser