[IMP] qweb: log a warning if a t-foreach is used without t-key

closes #40
This commit is contained in:
Géry Debongnie
2019-04-16 17:49:33 +02:00
parent e19540fb04
commit b89327c831
4 changed files with 16 additions and 9 deletions
+3 -3
View File
@@ -292,7 +292,7 @@ describe("connecting a component to store", () => {
class App extends Component<any, any, any> {
inlineTemplate = `
<div>
<t t-foreach="props.todos" t-as="todo">
<t t-foreach="props.todos" t-as="todo" t-key="todo">
<t t-widget="Todo" t-props="todo"/>
</t>
</div>`;
@@ -340,7 +340,7 @@ describe("connecting a component to store", () => {
class App extends Component<any, any, any> {
inlineTemplate = `
<div>
<span t-foreach="props.todos" t-as="todo">
<span t-foreach="props.todos" t-as="todo" t-key="todo">
<t t-esc="todo.title"/>
</span>
</div>`;
@@ -487,7 +487,7 @@ describe("connecting a component to store", () => {
class App extends Component<any, any, any> {
inlineTemplate = `
<div>
<span t-foreach="props.beers" t-as="beer"><t t-esc="beer.name"/></span>
<span t-foreach="props.beers" t-as="beer" t-key="beer.name"><t t-esc="beer.name"/></span>
</div>`;
}