Commit Graph
2 Commits
Author SHA1 Message Date
Victor Feyens 02e7d0f47d [IMP] base: restrict decimal precision name changes
The names of the decimal precision shouldn't be modified as this field 
is used as reference in the code.

Modifying (e.g. translating) the name of a decimal precision will 
disable the precision, always using 2 as precision fallback when the 
specified precision is not found.
2020-11-27 16:10:01 +00:00
Mitali Patel 0c5121a979 [IMP] decimal_precision: integrate into base
The decimal precision feature makes sense to be an ORM feature, no need to be
in a specific module

Previous syntax was
    from odoo.addons import decimal_precision as dp
    fields.Float(digits=dp.get_precision('Foo'))

and now is:
    fields.Float(digits='Foo')

Remove the possibility to have a callable method on the digits attribute (it
was only used for precision anyway) and directly retrieve the digits on the
decimal.precision model

Rename the method digits to get_digits to avoid confusion between the field
attribute when declaring a field and the method to retrieve the precision

Task id: 48198
2019-07-03 11:15:48 +00:00