-
- Downloads
[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.
Showing
- addons/account/models/account.py 1 addition, 3 deletionsaddons/account/models/account.py
- addons/analytic/models/analytic_account.py 1 addition, 2 deletionsaddons/analytic/models/analytic_account.py
- addons/l10n_be_intrastat/models/l10n_be_intrastat.py 3 additions, 5 deletionsaddons/l10n_be_intrastat/models/l10n_be_intrastat.py
- addons/product/models/product.py 2 additions, 4 deletionsaddons/product/models/product.py
- addons/product/models/product_pricelist.py 1 addition, 1 deletionaddons/product/models/product_pricelist.py
- addons/stock/models/product.py 9 additions, 12 deletionsaddons/stock/models/product.py
- addons/stock/models/stock_location.py 4 additions, 7 deletionsaddons/stock/models/stock_location.py
- addons/website/models/website.py 1 addition, 3 deletionsaddons/website/models/website.py
- addons/website_forum_doc/models/forum_documentation_toc.py 2 additions, 4 deletionsaddons/website_forum_doc/models/forum_documentation_toc.py
- odoo/addons/base/models/ir_ui_menu.py 1 addition, 2 deletionsodoo/addons/base/models/ir_ui_menu.py
- odoo/addons/base/models/res_partner.py 2 additions, 4 deletionsodoo/addons/base/models/res_partner.py
- odoo/addons/test_new_api/models.py 1 addition, 3 deletionsodoo/addons/test_new_api/models.py
- odoo/models.py 91 additions, 154 deletionsodoo/models.py
- odoo/osv/expression.py 13 additions, 16 deletionsodoo/osv/expression.py
Loading
Please register or sign in to comment