diff options
| author | Nans Lefebvre <len@odoo.com> | 2019-12-02 15:43:43 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2019-12-04 14:09:56 +0000 |
| commit | 09908b736fd9e7ffac08783f9771e7a8ac071d4f (patch) | |
| tree | 55351638d31dcf928dacbe227068c5b238fc0af8 /addons/l10n_cl | |
| parent | ba5b77427dc5fcf0c1307d49b65dd2023ccfd716 (diff) | |
[FIX] base: when saving settings, only reset environment if modules were installed/uninstalled
Execute the tests from ea574fe9ff644 and 9e9ac5ced80b30,
which are in a SavepointCase.
The second test fails on a cache_miss.
Whats happens is the following:
- the second test starts with the environment from the beginning of the
first test. However its envs has a reference to environments that
were created during the first test.
- when computing the field, the ORM finds the value in a zombie
environment, so does not recompute it
- when trying to get the value, the value is not in cache
The issue is that going through res.config.settings's execute resets the
envs.
One solution is to put:
self.addCleanup(lambda: setattr(self.env.envs, 'envs', envs))
in SavepointCase's setup.
However in that case the reset is not needed at all:
it's necessary only if there were some modules to install.
Unfortunately to_install and to_uninstall are not symmetric:
to_uninstall contains only modules that should be uninstalled, whereas
to_install contains everything, and only filters later what actions
really need to be performed.
In this case, we can rely on the result of the installation process.
closes odoo/odoo#41126
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Diffstat (limited to 'addons/l10n_cl')
0 files changed, 0 insertions, 0 deletions
