diff options
| author | Raphael Collet <rco@odoo.com> | 2018-01-25 15:08:16 +0100 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2018-02-28 10:33:44 +0100 |
| commit | e724858d508a2a7a938455a49f7dc509f6eac4c6 (patch) | |
| tree | 612611d67a4d44991b3757ad1dcd94d872c7de9b /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | 80f1ac3599ee630e7556ff4fcf3eb192931eccd8 (diff) | |
[REF] models: use `parent_path` to implement parent_store
This replaces the former modified preorder tree traversal (MPTT) with the
fields `parent_left`/`parent_right`. Each record is associated to a string
`parent_path`, that represents the path from its root node to itself. The path
is made of the node ids suffixed with a slash:
a node | id | parent_path
/ \ a | 42 | 42/
... b b | 63 | 42/63/
/ \ c | 84 | 42/63/84/
c d d | 85 | 42/63/85/
This field provides an efficient implementation for parent_of/child_of queries:
the nodes in the subtree of record are the ones where `parent_path` starts with
the `parent_path` of record. It is also more efficient to maintain than the
MPTT fields, and less sensitive to concurrent updates, because the value of
`parent_path` does not depend on sibling nodes.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
