When modifying a field's decimal precision, the caches are cleared in
order to retrieve the new value from the database. As the new value is
retrieved in pure SQL, one has to flush the updates before doing the
query!
X-original-commit: 8a9617d045c2afda8d804a5863df927012f0692c
Code's been dead since 3407fb70e4
essentially inlined its behaviour into the base class.
closesodoo/odoo#53774
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.
Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
As the decimal_precision module was removed, allow code like
from odoo.addons import decimal_precision as dp
fields.Float(digits=dp.get_precision('Foo')
to keep working
Co-authored-by: Olivier Dony <odo@odoo.com>
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