diff options
| author | Raphael Collet <rco@odoo.com> | 2021-01-08 09:55:30 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2021-01-08 10:50:26 +0000 |
| commit | b7676ec33172e6196b5fd1eda4df730ebf90eb6b (patch) | |
| tree | cbb9d1b3f5fb233e794167f70eda75d4f618daa4 /addons/website/static | |
| parent | 4fcacfac8967a3facbe751f748faff02033ce0ae (diff) | |
[FIX] core: avoid access error when flushing
This takes a former patch one step further.
Assume you recompute a field on two records, and the computation assigns
the first record but not the second one. Before this patch, the
recomputation process was accessing the field on both records. When
accessing the first record, both records are recomputed, and the value
of the first one is found in cache. When accessing the second record,
no recomputation is made (it has been done already), and the cache is
empty. The field is thus fetched from database, and this crashes because
of insufficient access rights.
This scenario was causing some obscure nondeterministic crashes in
tests. The nondeterminism comes from the choice of the environment for
flushing (it should not be in superuser mode); the order of records in
the set to compute; the order in which records are assigned in the
compute method; the fact that the compute method should assign some
records and some not.
The fix consists in adding a method that processes pending computations,
without doing anything special for unassigned records. The method is
used in field accessors (__get__ and mapped) and in method recompute().
The access error is gone because the recomputation no longer tries to
get the value of a field to compute.
closes odoo/odoo#64250
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Diffstat (limited to 'addons/website/static')
0 files changed, 0 insertions, 0 deletions
