Disable prefetch on env-computed fields

As in the inverse field that write the value into the <field>_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.
This commit is contained in:
Guewen Baconnier 2018-07-19 21:59:37 +02:00 committed by Stéphane Bidoul (ACSONE)
parent e0832cb649
commit 27c1a41f24
No known key found for this signature in database
GPG Key ID: BCAB2555446B5B92
1 changed files with 1 additions and 0 deletions

View File

@ -258,6 +258,7 @@ class ServerEnvMixin(models.AbstractModel):
field.required = False field.required = False
field.copy = False field.copy = False
field.sparse = None field.sparse = None
field.prefetch = False
def _server_env_add_is_editable_field(self, base_field): def _server_env_add_is_editable_field(self, base_field):
"""Add a field indicating if we can edit the env-computed fields """Add a field indicating if we can edit the env-computed fields