[FIX] website: restore page dependencies tooltip in page property

See commit [1] for in-depth explanation and framework-js change but
basically, `renderToElement` do not allow multiple root nodes since
[2].

The fix is just about using the correct method to render multiple root
nodes. Without the fix, it just crashed when you click on the page
dependencies links.

Step to reproduce:
- Go to /
- Open Page Properties
- Edit / to /test
- A list of possible dependencies will be shown, it's a link that can be
  clicked to open a tooltip to have more details
- Clicking on it crash without this commit

[1]: https://github.com/odoo/odoo/commit/2cff7e4094ebb4b56ab17a1462ff358b4b3e7ffd
[2]: https://github.com/odoo/odoo/commit/6303a3eacdca012649a2ffda627b65c17a7217f1

closes odoo/odoo#145715

Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
This commit is contained in:
Romain Derie
2023-12-12 17:03:41 +00:00
parent 480dfc1538
commit 8bfc6bcb3a
@@ -6,7 +6,7 @@ import {useService, useAutofocus} from "@web/core/utils/hooks";
import {sprintf} from "@web/core/utils/strings";
import {WebsiteDialog} from './dialog';
import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog";
import { renderToElement } from "@web/core/utils/render";
import { renderToFragment } from "@web/core/utils/render";
import { Component, useEffect, useState, xml, useRef } from "@odoo/owl";
export class PageDependencies extends Component {
@@ -48,7 +48,7 @@ export class PageDependencies extends Component {
boundary: 'viewport',
placement: 'right',
trigger: 'focus',
content: renderToElement("website.PageDependencies.Tooltip", {
content: renderToFragment("website.PageDependencies.Tooltip", {
dependencies: this.state.dependencies,
}),
}).popover('toggle');