Files
odoo_source/addons/sale_project
Denis Ledoux 236a03f3e7 [FIX] sale_project: action_view_task performance
Since revision 81b5ef93a773b94a4e3770632469c692b0ff57fa,
adding by default the filter `sale_order_id`
which does:
```py
<field name="sale_order_id" string="Sale Order"
    filter_domain="['|', ('sale_order_id', 'ilike', self), ('sale_line_id', 'ilike', self)]"
/>
```

becomes useless, because the final domain, with that `[('id', 'in', self.tasks_ids.ids)]` becomes:
```py
[
	"&",
	"&",
	"&",
	[
		"project_id",
		"!=",
		false
	],
	[
		"display_in_project",
		"=",
		true
	],
	[
		"id",
		"in",
		[
			3341211,
			3526685,
			3692221
		]
	],
	"|",
	[
		"sale_order_id",
		"ilike",
		"SO2023/123456"
	],
	[
		"sale_line_id",
		"ilike",
		"SO2023/123456"
	]
]
```

which makes an "AND" connection between the task ids domain leaf and the
sale order name ilike leaves, and all these task ids will come from
these SO names, making the AND useless.

In addition to be useless, it downgrades the performance.
On Odoo.com,
- with the filter `sale_order_id`: 15473 ms
- without the filter `sale_order_id`: 39ms

opw-3752003

closes odoo/odoo#159205

X-original-commit: 1a9302dc3a9b0d9323612c10e0f3a91300bb89fd
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2024-03-26 09:54:30 +00:00
..