Hello, Recently I noticed that there is a _parent_store attribute in a product.category, I checked in odoo, but didn't get the exact idea why it is used. Can anybody help me to understand what the _parent_store attribute actually does? Thank you in advance :)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Parent-child tree relationships are represented using a many-to-one relationship with the same model, where each record holds a reference to its parent. The inverse one-to-many relationship represents the record's direct children.
product.category model uses hierarchical data structures (parent-child relationships), Optimize hierarchy tree searching can be enabled by setting the _parent_store=True model attribute and adding the parent_path helper field. This helper field stores additional information about the hierarchy tree structure, which is used to run faster queries
Note: the parent_path field must also be added, and it must be indexed.
Thank you Waleed Ali Mohsen, Now I am getting what the _parent_store is! This explanation saves a lot of my time.
Hi Jay,
It is a Nested set of model.It manage hierarchical data structures with unbound depth in SQL. The article Managing Hierarchical Data in MySQL .
_parent_store to False should be sufficient as a workaround for an existing database. The framework can handle child_of operator on models where _parent_store is False, it will simply do multiple queries for traversing the hierarchy. Only the parent_id column is required for child_of.
Regards
So basically, It just simply used to optimize the backend performance by reducing no. of queries
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 7 25
|
1536 | ||
|
2
thg 11 24
|
6575 | ||
|
2
thg 10 24
|
3507 | ||
|
2
thg 8 24
|
2019 | ||
|
3
thg 7 24
|
8419 |