File tree Expand file tree Collapse file tree 8 files changed +23
-18
lines changed Expand file tree Collapse file tree 8 files changed +23
-18
lines changed Original file line number Diff line number Diff line change 11
11
</div >
12
12
13
13
</t >
14
-
14
+
15
15
</templates >
Original file line number Diff line number Diff line change 2
2
<templates xml : space =" preserve" >
3
3
4
4
<t t-name =" awesome_owl.counter" >
5
- <div style =" border: 1px solid #ccc; padding: 15px; margin: 10px; width: fit-content; height:fit-content; display: inline" >
5
+ <div style =" border: 1px solid #ccc; padding: 15px; margin: 10px; width: fit-content; display: inline" >
6
6
<label style =" margin:10px" >Counter: <t t-esc =" count.value" /></label >
7
- <button class =" btn" t-on-click =" increment" style =" background-color: purple; color: white" >Increment</button >
7
+ <button class =" btn" t-on-click =" increment" style =" background-color: purple; color: white" >
8
+ Increment
9
+ </button >
8
10
</div >
9
11
</t >
10
-
12
+
11
13
</templates >
Original file line number Diff line number Diff line change 1
1
/** @odoo -module **/
2
2
3
3
import { Component , useState } from "@odoo/owl" ;
4
- import { Counter } from "./counter/counter" ;
5
4
import { Card } from "./card/card" ;
5
+ import { Counter } from "./counter/counter" ;
6
6
import { TodoList } from "./todo_list/todo_list" ;
7
7
8
8
export class Playground extends Component {
@@ -14,7 +14,7 @@ export class Playground extends Component {
14
14
setup ( ) {
15
15
this . content1 = "<u>Card Content 1</u>" ;
16
16
this . content2 = "<u>Card Content 2</u>" ;
17
- this . state = useState ( {
17
+ this . state = useState ( {
18
18
sum : 0 ,
19
19
} ) ;
20
20
}
Original file line number Diff line number Diff line change 26
26
</div >
27
27
28
28
</t >
29
-
29
+
30
30
</templates >
Original file line number Diff line number Diff line change 2
2
<templates xml : space =" preserve" >
3
3
4
4
<t t-name =" awesome_owl.todo_item" >
5
- <p class =" card-text" t-att-class =" props.todo.isCompleted ? 'text-decoration-line-through text-muted' : '' " >
6
- <t t-esc =" props.todo.id" />. <t t-esc =" props.todo.description" />
5
+ <p
6
+ class =" card-text"
7
+ t-att-class =" props.todo.isCompleted ? 'text-decoration-line-through text-muted' : '' " >
8
+ <t t-esc =" props.todo.id" />. <t t-esc =" props.todo.description" />
7
9
</p >
8
10
</t >
9
-
11
+
10
12
</templates >
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export class TodoList extends Component {
22
22
} ,
23
23
} ;
24
24
25
- addTodo ( ev ) {
25
+ addTodo ( ev ) {
26
26
let input_val = ev . target . value ;
27
27
if ( ev . keyCode === 13 && input_val != "" ) {
28
28
this . todos . push ( {
Original file line number Diff line number Diff line change 10
10
'data' : [
11
11
'security/ir.model.access.csv' ,
12
12
'views/estate_property_views.xml' ,
13
- 'views/estate_property_type_views.xml' ,
14
13
'views/estate_property_tag_views.xml' ,
15
14
'views/estate_property_type_offer.xml' ,
15
+ 'views/estate_property_type_views.xml' ,
16
16
'views/estate_user_views.xml' ,
17
17
'views/estate_menus.xml' ,
18
18
],
Original file line number Diff line number Diff line change @@ -56,11 +56,12 @@ def action_refuse_offer(self):
56
56
record .status = 'refused'
57
57
return True
58
58
59
- @api .model
59
+ @api .model_create_multi
60
60
def create (self , vals ):
61
- if vals ['price' ] <= self .env ['estate.property' ].browse (vals ['property_id' ]).best_price :
62
- raise UserError (self .env ._ ('The offer price must be greater than the best offer.' ))
61
+ for val in vals :
62
+ if val ['price' ] <= self .env ['estate.property' ].browse (val ['property_id' ]).best_price :
63
+ raise UserError (self .env ._ ('The offer price must be greater than the best offer.' ))
63
64
64
- if self .env ['estate.property' ].browse (vals ['property_id' ]).state == 'new' :
65
- self .env ['estate.property' ].browse (vals ['property_id' ]).state = 'offer_received'
66
- return super (TestModel , self ).create (vals )
65
+ if self .env ['estate.property' ].browse (val ['property_id' ]).state == 'new' :
66
+ self .env ['estate.property' ].browse (val ['property_id' ]).state = 'offer_received'
67
+ return super ().create (vals )
You can’t perform that action at this time.
0 commit comments