diff options
| author | Xavier Morel <xmo@odoo.com> | 2019-04-30 07:19:30 +0000 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2019-04-30 07:39:20 +0000 |
| commit | 2fc7657975c216b3b204d5815710c1669f251168 (patch) | |
| tree | c0e1cbe739c4be03076a4a37d52c158a43b49df6 /doc/reference/javascript_reference.rst | |
| parent | d7d4ebb312994ace73af951b3635e3f909d228c8 (diff) | |
[FIX] core: reintroduce computation of parent_store in auto_init
When 80f1ac3599ee630e7556ff4fcf3eb192931eccd8 removed deferral of
parent store computations (the MPTT at the time), it also errornously
removed the computation during auto_init.
As a result, when adding a `_parent_store = True` and `parent_path`
field to an existing model (e.g. in an override, or when updating the
database) the column will be created but the column will be
False-filled, and hierarchical queries break as odoo will attempt to
perform string operations on `False` (either `False + '%'` or
`False.split('/')`).
Fix the issue by reintroducing the parent_store computation.
Note: uses the same gating as the old commit, the computation is only
performed if this is the install/update where the parent_path column
gets created.
We could alternatively gate on just _parent_store, but even the RCTE
can be expensive when executed on millions of records (at least when
it has to set all the parent_path) and while it could allow inserting
a bunch of records when calling -u to generate their parent_paths, it
feels like the caller could and would do so manually as they might
have shuffled the tree and need to update more than just the records
for which parent_path is null.
closes odoo/odoo#33034
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions
