[FIX] core: decimal precision after update
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
This commit is contained in:
@@ -28,6 +28,7 @@ class DecimalPrecision(models.Model):
|
||||
@api.model
|
||||
@tools.ormcache('application')
|
||||
def precision_get(self, application):
|
||||
self.flush(['name', 'digits'])
|
||||
self.env.cr.execute('select digits from decimal_precision where name=%s', (application,))
|
||||
res = self.env.cr.fetchone()
|
||||
return res[0] if res else 2
|
||||
|
||||
Reference in New Issue
Block a user