Skip to content

Commit

Permalink
[FIX] website: fix opening the page manager in debug mode
Browse files Browse the repository at this point in the history
Before this commit, opening the Page Manager in debug mode would throw
an error, stating that the website.RecordFilter has a t-foreach with
duplicated keys.

As per the [owl documentation]: "Owl requires the presence of a t-key
directive, to be able to properly reconcile renderings." and "A key
should be a unique number or string."

This commit fixes the keys to be the website id instead of the website
object.

[owl documentation]: https://github.com/odoo/owl/blob/master/doc/reference/templates.md#loops

closes #104425

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
  • Loading branch information
younn-o committed Oct 28, 2022
1 parent 5f18f06 commit 0d1c263
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/website/static/src/components/views/page_list.xml
Expand Up @@ -41,7 +41,7 @@
<i class="me-1 fa fa-globe"/><span t-esc="state.activeWebsite.name"/>
</button>
<div class="dropdown-menu">
<t t-foreach="websiteSelection" t-as="website" t-key="website">
<t t-foreach="websiteSelection" t-as="website" t-key="website.id">
<a role="menuitem" href="#" class="dropdown-item" t-on-click="() => this.onSelectWebsite(website)"><t t-esc="website.name"/></a>
<div t-if="!website.id" class="dropdown-divider"/>
</t>
Expand Down

0 comments on commit 0d1c263

Please sign in to comment.