odoo/openerp
Cedric Snauwaert fa2f7b86bf [FIX] product: remove digits_precision from uom factor fields
Remove the hardcoded precision of 12 on factor and factor_inv,
to use the complete natural precision of NUMERIC types,
preserving all significant digits.

e.g. a UoM with a factor_inv of 6.0 used to be computed as:
factor_inv: 6.0 -> factor: 0.166666666667 (1.0/6.0, rounded to 12 digits) -> factor_inv: 5.999999999988 (1.0/factor)
which could lead to errors such 12*0.166666666667 = 2.000000000004 instead of 2.0

Slightly changed the way the ORM handles float fields to allow setting `digits=0`
as a way to explicitly require a NUMERIC value but without enforcing/rounding
the values at the ORM level, i.e. a truly full-precision field.

NUMERIC type has unlimited precision but is less efficient so should not be
used as the default behaviour, which is why we keep float8 as an alternative.

Modified the view to display the product UOM factor with a 5 digits value by default.
This value is for usability purpose only, the field still accepts bigger precision, by
setting the `digits` option on the field in the form view.

This change is safe in a stable series, the `digits=0` alternative is
treated the same as the default `digits=None` everywhere in the framework,
except when creating the database field.
2014-10-22 14:28:34 +02:00
..
addons [FIX] base: support float rounding with rounding_method=UP (ceiling) 2014-10-22 14:28:22 +02:00
cli [FIX] Fix the yml test with option --test-file. 2014-03-19 11:48:47 +01:00
conf cron cleanup, back to the Kernighan KISS roots 1min poll time, rely only on database, multiprocess/multiserver ready. 2012-12-09 18:04:47 +01:00
modules [FIX] loading: always process auto-installed modules for new databases 2014-09-17 15:11:01 +02:00
osv [FIX] product: remove digits_precision from uom factor fields 2014-10-22 14:28:34 +02:00
report [FIX] report: page numbering rml reports 2014-10-21 15:36:01 +02:00
service [MERGE] [FIX] databases list: allow to have entries with unicode char in the database list (opw 589765) 2014-02-14 15:44:44 +01:00
tests [FIX] tools.translate: when loading entries from a PO file, use also the POT. 2014-08-13 23:07:40 +02:00
tools [FIX] base: support float rounding with rounding_method=UP (ceiling) 2014-10-22 14:28:22 +02:00
workflow [MERGE] From trunk (second time) 2012-12-17 15:47:53 +01:00
.apidoc API doc: move settings file from bin/ to openerp/ 2011-06-23 12:08:07 +03:00
PKG-INFO [IMP] openerp python module. 2011-02-07 13:57:23 +01:00
__init__.py [FIX] timezone: under windows os.environ["TZ"] was not affecting the server, 2013-03-07 13:16:37 +01:00
exceptions.py [FIX] xmlrpc: handle old/new exceptions with old/new clients. 2011-09-30 10:50:12 +02:00
import_xml.rng [IMP] rng: forbid redundant @type for menuitem, now inferred from the action type + minor cleanup 2012-08-22 16:49:46 +02:00
loglevels.py [FIX] incorrect docstrings or docstring param names not matching actual param names 2012-12-14 14:07:58 +01:00
netsvc.py [FIX] add the logging handler only to the root logger. let the loggers propagate to allow more than one handler 2014-03-12 18:18:19 +01:00
pooler.py [IMP] cron: remove useless pooljobs and schedule_cron_jobs methods 2012-12-21 14:37:51 +01:00
release.py [FIX] we are not in alpha anymore 2013-01-03 18:08:09 +01:00
sql_db.py [FIX] Allow missing opcodes, harden check for private attributes (dunder), check inside embedded code objects. 2014-04-09 17:16:59 +02:00