Before this commit, when the user searches all the open tasks (the tasks without a stage set or the tasks are in a stage where `fold` is False), this search could be slow when a huge number of active tasks is in db and most of that tasks is in a stage folded. This commit stores the `is_closed` field to avoid doing a join into the stage table to know if the stage linked to the stage is folded or not. Because `is_closed` is a related of `stage_id.fold` and so we will avoid doing a sql join to know if the task is a open one or not. To further increase this search, an index is added too. Closes #85513 closes odoo/odoo#85968 Related: odoo/enterprise#24828 Related: odoo/enterprise#25055 X-original-commit: cf8bb93 Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com> Co-authored-by: Yannick Tivisse <yti@odoo.com> Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>