odoo/openerp/osv
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
..
__init__.py API docs: settings file and titles at modules 2011-06-23 12:03:57 +03:00
expression.py Server Translation: Fixed the issue search on translated field do not return true result, search on tranlsated field fails due to expression parsing which fetches ids from ir_translation as well as working table and UNION of this makes search fruitless, also search fails for in language other then english when you enter part of a string for the field to search. 2014-06-24 17:42:48 +05:30
fields.py [FIX] base: python 2.6 incompatibility for dictionary comprehension 2014-08-20 10:28:37 +02:00
orm.py [FIX] product: remove digits_precision from uom factor fields 2014-10-22 14:28:34 +02:00
osv.py [IMP] osv: display full traceback in terminal (not client side) when a check fails instead of minimal error 2014-01-08 15:05:54 +01:00
query.py [REM] unnecessary parens 2012-12-14 13:38:03 +01:00