[FIX] decimal_precision: clearing the cache is suffcient when decimal precision change.

[IMP] decimal_precision: call digits_change() on any field that support it, not only on float and function fields

bzr revid: chs@openerp.com-20140116154645-sy4zhdgqc48xaqbx
This commit is contained in:
Christophe Simonis 2014-01-16 16:46:45 +01:00
parent 2f90f80ba0
commit 70e201b07e
1 changed files with 2 additions and 2 deletions

View File

@ -49,9 +49,9 @@ class decimal_precision(osv.osv):
self.precision_get.clear_cache(self)
for obj in self.pool.obj_list():
for colname, col in self.pool.get(obj)._columns.items():
if isinstance(col, (fields.float, fields.function)):
if hasattr(col, 'digits_change'):
col.digits_change(cr)
RegistryManager.signal_registry_change(cr.dbname)
RegistryManager.signal_caches_change(cr.dbname)
def create(self, cr, uid, data, context=None):
res = super(decimal_precision, self).create(cr, uid, data, context=context)