File tree Expand file tree Collapse file tree 11 files changed +107
-7
lines changed
Expand file tree Collapse file tree 11 files changed +107
-7
lines changed Original file line number Diff line number Diff line change 1+ import { Component } from "@odoo/owl" ;
2+
3+ export class Card extends Component {
4+ static template = "awesome_owl.card" ;
5+ static props = {
6+ title : String ,
7+ content : String
8+ } ;
9+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <templates xml : space =" preserve" >
3+ <t t-name =" awesome_owl.card" >
4+ <div class =" card d-inline-block m-2" style =" width: 18rem; border: 2px solid black; border-radius: 12px; margin-top: 10px; text-align:center;" >
5+ <div class =" card-body" >
6+ <h4 class =" card-title" style =" background-color: blue; margin:0; border-radius:14px;" >
7+ <t t-esc =" props.title" />
8+ </h4 >
9+ <p class =" card-text" style =" background-color: green; margin:10px; border-radius:14px;" >
10+ <t t-esc =" props.content" />
11+ </p >
12+ </div >
13+ </div >
14+ </t >
15+ </templates >
Original file line number Diff line number Diff line change 1+ import { Component , useState } from "@odoo/owl" ;
2+
3+ export class Counter extends Component {
4+ static template = "awesome_owl.counter" ;
5+
6+ setup ( ) {
7+ this . state = useState ( { value : 0 } ) ;
8+ }
9+
10+ increment ( ) {
11+ this . state . value ++ ;
12+ }
13+
14+ decrement ( ) {
15+ this . state . value -- ;
16+ }
17+
18+ reset ( ) {
19+ this . state . value = 0 ;
20+ }
21+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <templates xml : space =" preserve" >
3+ <t t-name =" awesome_owl.counter" >
4+ <div style =" border: 2px solid black; border-radius: 12px; width: fit-content; padding: 10px; margin-top:10px;" >
5+ <p >Counter: <t t-esc =" state.value" /></p >
6+ <button class =" btn btn-primary" t-on-click =" increment" >Increment</button >
7+ <button class =" btn btn-primary" t-on-click =" decrement" >Decrement</button >
8+ <button t-if =" state.value != 0" class =" btn btn-primary" t-on-click =" reset" >Reset</button >
9+ </div >
10+ </t >
11+ </templates >
Original file line number Diff line number Diff line change 1- import { Component } from "@odoo/owl" ;
1+ import { Component , useState } from "@odoo/owl" ;
2+ import { Counter } from "./counter/counter" ;
3+ import { Card } from "./card/card" ;
24
35export class Playground extends Component {
46 static template = "awesome_owl.playground" ;
7+ static components = { Counter, Card} ;
8+
9+ setup ( ) {
10+ this . state = useState ( { value : 0 } ) ;
11+ }
12+
13+ increment ( ) {
14+ this . state . value ++ ;
15+ }
16+
17+ decrement ( ) {
18+ this . state . value -- ;
19+ }
20+
21+ reset ( ) {
22+ this . state . value = 0 ;
23+ }
524}
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<templates xml : space =" preserve" >
3-
43 <t t-name =" awesome_owl.playground" >
5- <div class =" p-3" >
6- hello world
4+ <div style =" border: 2px solid black; border-radius: 12px; width: fit-content; padding: 10px; margin-top:5px;" >
5+ <p >Counter: <t t-esc =" state.value" /></p >
6+ <button class =" btn btn-primary" t-on-click =" increment" >Increment</button >
7+ <button class =" btn btn-primary" t-on-click =" decrement" >Decrement</button >
8+ <button t-if =" state.value != 0" class =" btn btn-primary" t-on-click =" reset" >Reset</button >
79 </div >
10+ <Counter />
11+ <Card title =" 'Hello'" content =" 'word'" />
12+ <Card title =" 'New'" content =" 'Card'" />
813 </t >
9-
1014</templates >
Original file line number Diff line number Diff line change 55 Real Estate Module to Buy and Sell Your Real Estate with Ease.
66 """ ,
77 "version" : "1.0" ,
8- "depends" : ["base" ],
8+ "depends" : ["base" , "sale" ],
99 "author" : "danal" ,
1010 "category" : "Category" ,
1111 "application" : True ,
1717 "views/estate_property_tag_views.xml" ,
1818 "views/estate_property_type_views.xml" ,
1919 "views/res_users_views.xml" ,
20+ "views/sale_order_views.xml" ,
2021 "views/estate_menus.xml" ,
2122 ],
2223}
Original file line number Diff line number Diff line change 44from . import estate_property_tag
55from . import estate_property_offer
66from . import res_users
7+ from . import sale_order
Original file line number Diff line number Diff line change 1+ from odoo import fields , models
2+
3+
4+ class SaleOrder (models .Model ):
5+ _inherit = "sale.order"
6+
7+ property_id = fields .Many2one ("estate.property" )
Original file line number Diff line number Diff line change 1212 <field name =" model" >estate.property.offer</field >
1313 <field name =" arch" type =" xml" >
1414 <list string =" Offer" editable =" bottom" decoration-danger =" status=='refused'" decoration-success =" status=='accepted'" >
15- <field name =" price" options =" {'type': 'number', 'step': 100}" />
1615 <field name =" partner_id" />
16+ <field name =" price" options =" {'type': 'number', 'step': 100}" />
1717 <field name =" validity" string =" Validity(days)" />
1818 <field name =" date_deadline" />
1919 <button name =" action_accept" string =" Accept" type =" object" icon =" fa-check" invisible =" status in ('accepted', 'refused')" />
You can’t perform that action at this time.
0 commit comments