Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Inventory
Entity: stock.warehouse.orderpoint
Compute Method: _compute_rules
| Inputs | Method | Outputs |
|---|---|---|
|
orderpoints_to_compute = self.filtered(lambda orderpoint: orderpoint.product_id and orderpoint.location_id)
rules_cache = {}
for orderpoint in orderpoints_to_compute:
- cache_key = (orderpoint.location_id, orderpoint.route_id, orderpoint.product_id.route_ids | orderpoint.product_id.categ_id.total_route_ids)
+ all_product_routes = orderpoint.product_id.route_ids | orderpoint.product_id.categ_id.total_route_ids | orderpoint.product_id.get_total_routes()
+ cache_key = (orderpoint.location_id, orderpoint.route_id, all_product_routes)
rule_ids = rules_cache.get(cache_key) or orderpoint.product_id._get_rules_from_location(
orderpoint.location_id, route_ids=orderpoint.route_id
)
orderpoint.rule_ids = rule_ids
rules_cache[cache_key] = rule_ids
(self - orderpoints_to_compute).rule_ids = False
|
|
