Skip to content

Commit 09aff26

Browse files
committed
[IMP] awesome_owl: task 7 (todo list v1)
1 parent 0135233 commit 09aff26

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

awesome_owl/static/src/todo_list/todo_item.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import { Component, useState } from "@odoo/owl"
22

33
export class TodoItem extends Component {
44
static template = "awesome_owl.TodoItem";
5+
56
static props = {
67
todo : {
7-
type: Object,
8-
shape: {
9-
id: Number,
10-
description: String,
11-
isCompleted: Boolean }
12-
}
13-
}
8+
id: Number,
9+
description: String,
10+
isCompleted: Boolean }
11+
12+
};
1413
}

awesome_owl/static/src/todo_list/todo_item.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
<t t-name="awesome_owl.TodoItem">
55
<div>
6-
<p>Id: <t t-esc="todo.id"/></p>
7-
<p>Description: <t t-esc="todo.description"/></p>
6+
<t t-out="props.todo.id"/>.
7+
<t t-out="props.todo.description"/>
88
</div>
99
</t>
1010

awesome_owl/static/src/todo_list/todo_list.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export class TodoList extends Component {
99
this.todos = useState([
1010
{ id:1, description: "buy bread", isCompleted: false },
1111
{ id:2, description: "buy milk", isCompleted: false },
12-
])
12+
{ id:3, description: "have lunch", isCompleted: true },
13+
]);
1314
}
1415
}
1516

awesome_owl/static/src/todo_list/todo_list.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<templates xml:space="preserve">
33

44
<t t-name="awesome_owl.TodoList">
5+
<div>
56
<p>Todo List:</p>
6-
<t t-foreach="todos" t-as="todo" t-key="todo.id">
7-
<p><t t-esc="todo.id"/>. <t t-esc="todo.description"/></p>
8-
</t>
7+
<p t-foreach="todos" t-as="td" t-key="td.id">
8+
<TodoItem todo="td"/>
9+
</p>
10+
</div>
911
</t>
1012

1113
</templates>

estate/views/estate_property_views.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<span>Expected price:</span>
122122
<field name="expected_price"/>
123123
</div>
124-
<div t-if="record.state == 'offer_received'">
124+
<div t-if="record.state.raw_value == 'offer_received'">
125125
<span>Best offer:</span>
126126
<field name="best_offer"/>
127127
</div>

0 commit comments

Comments
 (0)