mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
ba34811f71
Because the default content of a t-call is compiled before the block of the t-call is created, the default content can sometimes incorrectly be treated as though it is at the root of the template. This causes various issues, in the case of a t-if, the default content will just replace the t-call entirely when truthy, and when falsy the template will not return anything, leading to a crash. Similar things occur with t-foreach and t-out with a default content. This commit fixes that by moving the block creation for the t-call ahead of the compilation of the default content. In doing so, it makes the context attribute "preventRoot" obsolete: the purpose of this attribute is to somehow make the code aware that the root of the template will be defined later, but because it wasn't propagated everywhere properly it caused this issue. Now that the root already exists before we compile the default content, we don't need it anymore.