From 27c1a41f2475edc6a4b9ce4ed4fbe0070f87b938 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 19 Jul 2018 21:59:37 +0200 Subject: [PATCH] Disable prefetch on env-computed fields As in the inverse field that write the value into the _env_default we have to browse the record, the prefetch has the effect of calling compute on the env-computed field which resets the value to it's previous state before we have the occasion to store it. --- server_environment/models/server_env_mixin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/server_environment/models/server_env_mixin.py b/server_environment/models/server_env_mixin.py index 37d4c16..89d39bb 100644 --- a/server_environment/models/server_env_mixin.py +++ b/server_environment/models/server_env_mixin.py @@ -258,6 +258,7 @@ class ServerEnvMixin(models.AbstractModel): field.required = False field.copy = False field.sparse = None + field.prefetch = False def _server_env_add_is_editable_field(self, base_field): """Add a field indicating if we can edit the env-computed fields