[IMP] base: avoid ormcache clear when setting ir.default to the same value
Purpose ======= On the res.config.settings model for example, calling execute without having changed a single parameter will make several writes on ir.default records. However, even if the written and the current values are the same, the cache will be invalidated several times. Part-of: odoo/odoo#82999
This commit is contained in:
@@ -80,7 +80,9 @@ class IrDefault(models.Model):
|
||||
('condition', '=', condition),
|
||||
])
|
||||
if default:
|
||||
default.write({'json_value': json_value})
|
||||
# Avoid clearing the cache if nothing changes
|
||||
if default.json_value != json_value:
|
||||
default.write({'json_value': json_value})
|
||||
else:
|
||||
self.create({
|
||||
'field_id': field.id,
|
||||
|
||||
Reference in New Issue
Block a user