This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2022-09-30 08:27:32,167 1 INFO zhinst_lab odoo.tools.profiler: | |
calls queries ms | |
stock.production.lot --------------------- /odoo/external-src/stock-logistics-workflow/stock_lot_product_qty_search/models/stock_production_lot.py, 17 | |
1 0 0.05 @profile | |
def _search_product_qty(self, operator, value): | |
1 0 0.04 if operator not in ("<", ">", "=", "!=", "<=", ">="): | |
raise UserError(_("Invalid domain operator %s", operator)) | |
1 0 0.03 if not isinstance(value, (float, int)): | |
raise UserError(_("Invalid domain right operand %s", value)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before: | |
|QUERY PLAN | | |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | |
|Unique (cost=54330961.69..54429026.37 rows=40000 width=106) (actual time=7771.241..7771.241 rows=1 loops=1) | | |
| -> Sort (cost=54330961.69..54363649.92 rows=13075291 width=106) (actual time=7771.240..7771.240 rows=1 loops=1) | | |
| Sort Key: partner.id, (NULL::integer), users.notification_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RECURSIVE location_tree AS ( | |
SELECT loc1.id, loc1.location_id, loc1.name | |
FROM stock_location loc1 | |
WHERE id = 2024 | |
UNION ALL | |
SELECT loc2.id, loc2.location_id, loc2.name | |
FROM stock_location loc2 | |
INNER JOIN location_tree lt ON lt.id = loc2.location_id | |
) SELECT id | |
FROM location_tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH recursive dep_tree AS ( | |
SELECT mdl0.id, mdl0.name, NULL::integer, 1 AS level, array[mdl0.id] AS path_info | |
FROM ir_module_module mdl0 | |
WHERE name = 'sale' -- state here the child module | |
UNION ALL | |
SELECT (SELECT mdl1.id FROM ir_module_module mdl1 WHERE mdl1.name = c.name), rpad('', p.level * 1, '_') || c.name, c.module_id, p.level + 1, p.path_info||c.id | |
FROM ir_module_module_dependency c | |
JOIN dep_tree p ON c.module_id = p.id | |
WHERE level < 5 -- define here the levels to be displayed | |
) |