From eff6ce5e48d96768ac8bfc366a8de6aaca5f415a Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Mon, 9 Nov 2020 16:29:19 +0000 Subject: [PATCH] [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 --- odoo/addons/base/models/decimal_precision.py | 1 + 1 file changed, 1 insertion(+) diff --git a/odoo/addons/base/models/decimal_precision.py b/odoo/addons/base/models/decimal_precision.py index 47281b4a1b8..11f50b3415c 100644 --- a/odoo/addons/base/models/decimal_precision.py +++ b/odoo/addons/base/models/decimal_precision.py @@ -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