Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c899377
[ADD] estate: Create estate property model
abkus-odoo May 8, 2026
50755fd
[IMP] estate: Initialize Estate application module
abkus-odoo May 11, 2026
aab3a9c
[IMP] estate: Add estate property model with essential fields
abkus-odoo May 12, 2026
cf4f109
[IMP] estate: add security access rights and model permissions
abkus-odoo May 14, 2026
2f69c9b
[IMP] estate: add UI action and views structure
abkus-odoo May 15, 2026
f174915
[IMP] estate: add menu, action, list and form views
abkus-odoo May 19, 2026
b5f0bed
[IMP] estate: add form and search views for properties
abkus-odoo May 21, 2026
4ef1bc9
[IMP] estate: revise previous chapters and begin relational fields
abkus-odoo May 22, 2026
d478584
[IMP] estate: improve code formatting and begin Many2one relations
abkus-odoo May 25, 2026
95dccd6
[IMP] estate: learn and implement Many2one relations
abkus-odoo May 27, 2026
5b00f3d
[IMP] estate: Understand Many2many field behavior and usage
abkus-odoo May 28, 2026
5298786
[IMP] estate: implement Many2many tags for properties
abkus-odoo May 29, 2026
5c6534e
[IMP] estate: add page for property offer
abkus-odoo Jun 2, 2026
3b4ac75
[IMP] estate: implement computed total_area field
abkus-odoo Jun 4, 2026
6304e13
[IMP] estate: compute best offer using mapped()
abkus-odoo Jun 5, 2026
97c0965
[IMP] estate: implement offer validity and property onchange logic
abkus-odoo Jun 8, 2026
6fa7566
[IMP] estate: implement property and offer state actions
abkus-odoo Jun 9, 2026
947e31e
[IMP] estate: implement SQL constraints for data integrity
abkus-odoo Jun 11, 2026
dd1cbe4
[IMP] estate: add property type One2many inline view and statusbar wi…
abkus-odoo Jun 17, 2026
bda719b
[IMP] estate: add ordering, sequence, and tag widget options
abkus-odoo Jun 18, 2026
453fb8c
[IMP] estate: improve views, filters and business rules
abkus-odoo Jun 22, 2026
3803ac1
[IMP] estate: implement stat button and offer filtering by property type
abkus-odoo Jun 23, 2026
5fac920
[IMP] estate: implement offer validation and property state logic
abkus-odoo Jun 25, 2026
b38d057
[ADD] estate_account: generate invoice on property sold
abkus-odoo Jul 1, 2026
cf6b343
[IMP] estate: enhance property management with Kanban & custom fields
abkus-odoo Jul 3, 2026
50d7120
[IMP] estate: implement property maintenance management workflow-Grou…
abkus-odoo Jul 8, 2026
c3ab538
[ADD] awesome_owl: complete Owl component exercises
abkus-odoo Jul 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions awesome_owl/static/src/card/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component } from "@odoo/owl";

export class Card extends Component {
static template = "awesome_owl.Card"

static props = {
title: String,
content: String,
};

}
15 changes: 15 additions & 0 deletions awesome_owl/static/src/card/card.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<t t-name="awesome_owl.Card">

<div class="card d-inline-block m-2" style="width:18rem;">
<div class="card-body">

<h5 class="card-title">
<t t-esc="props.title"/>
</h5>
<div class="card-text" t-out="props.content"/>

</div>
</div>

</t>
22 changes: 22 additions & 0 deletions awesome_owl/static/src/counter/counter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Component, useState } from "@odoo/owl";

export class Counter extends Component {
static template = "awesome_owl.Counter";

setup() {
this.state = useState({
value: 0
});
}

static props = {
onChange: { type: Function, Optional: true }
};

increment() {
this.state.value++;
if (this.props.onChange) {
this.props.onChange();
}
}
}
14 changes: 14 additions & 0 deletions awesome_owl/static/src/counter/counter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">

<t t-name="awesome_owl.Counter">
<p>
Counter:
<t t-esc="state.value"/>
</p>
<button class="btn-primary" t-on-click="increment">
Increment
</button>
</t>

</templates>
20 changes: 19 additions & 1 deletion awesome_owl/static/src/playground.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
import { Component } from "@odoo/owl";
import { Component, markup, useState } from "@odoo/owl";
import { Counter } from "./counter/counter";
import { Card } from "./card/card";
import { TodoList } from "./todo/todo_list";

export class Playground extends Component {
static template = "awesome_owl.playground";
static components = { Counter, Card, TodoList };

setup() {
this.html = "<b>Hello Im Abhishek</b>"
this.mark = markup("<b> Hello Im Abhishek</b>")

this.state = useState({
sum: 0
});
}

incrementSum() {
this.state.sum++;
}

}
8 changes: 8 additions & 0 deletions awesome_owl/static/src/playground.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
<t t-name="awesome_owl.playground">
<div class="p-3">
hello world
<Counter onChange.bind="incrementSum"/>
<Counter onChange.bind="incrementSum"/>
<h3> Sum: <t t-esc="state.sum"/> </h3>
<Card
title="'Card 1'"
content="'This is the first card.'"
/>
<TodoList />
</div>
</t>

Expand Down
17 changes: 17 additions & 0 deletions awesome_owl/static/src/todo/todo_item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component } from "@odoo/owl"

export class TodoItem extends Component {
static template = "awesome_owl.TodoItem"

static props = {
todo: {
type: Object,
shape: {
id: Number,
description: String,
isCompleted: Boolean,
},
},
};

}
15 changes: 15 additions & 0 deletions awesome_owl/static/src/todo/todo_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<templates xml:space="preserve">
<t t-name="awesome_owl.TodoItem">
<div
t-att-class="{
'text-muted': props.todo.isCompleted,
'text-decoration-line-through': props.todo.isCompleted
}"
>
<span>
<t t-esc="props.todo.id"/> -
<t t-esc="props.todo.description"/>
</span>
</div>
</t>
</templates>
26 changes: 26 additions & 0 deletions awesome_owl/static/src/todo/todo_list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Component, useState } from "@odoo/owl"
import { TodoItem } from "./todo_item"

export class TodoList extends Component {
static template = "awesome_owl.TodoList"
static components = { TodoItem };

setup() {
this.todos = useState([]);
this.nextId = 1;
}

addTodo(ev) {
if (ev.keyCode === 13) {
const description = ev.target.value.trim();

this.todos.push({
id: this.nextId++,
description: description,
isCompleted: false,
});

ev.target.value = "";
}
}
}
14 changes: 14 additions & 0 deletions awesome_owl/static/src/todo/todo_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<templates xml:space="preserve">
<t t-name="awesome_owl.TodoList">
<div>
<input
type="text"
placeholder="Enter a new task"
t-on-keyup="addTodo"
/>
<t t-foreach="todos" t-as="todo" t-key="todo.id">
<TodoItem todo="todo" />
</t>
</div>
</t>
</templates>
1 change: 1 addition & 0 deletions estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "real estate",
"version": "1.0",
"summary": "Estate management",
"description": "Estate management",
"author": "Odoo S.A.",
"category": "tutorials",
"depends": ["base"],
"data": [
"security/ir.model.access.csv",
"views/estate_property_views.xml",
"views/estate_property_offer_views.xml",
"views/estate_property_type_views.xml",
"views/estate_property_tag_views.xml",
"views/estate_property_maintenance_views.xml",
"views/estate_menus.xml",
"views/res_users_views.xml",
],
"license": "LGPL-3",
"application": True,
"installable": True
}
6 changes: 6 additions & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import estate_property
from . import estate_property_type
from . import estate_property_tag
from . import estate_property_offer
from . import estate_property_maintenance
from . import res_users
147 changes: 147 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
from dateutil.relativedelta import relativedelta

from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools.float_utils import float_compare, float_is_zero


class EstateProperty(models.Model):
_name = "estate.property"
_description = "Real Estate Property"
_order = "id desc"

name = fields.Char(required=True)
description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date(
default=lambda self: (
fields.Date.today() + relativedelta(months=3)
)
)
expected_price = fields.Float()
selling_price = fields.Float(readonly=True, copy=False)
bedrooms = fields.Integer(default=2)
living_area = fields.Integer()
facades = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()
total_area = fields.Integer(compute="_compute_total")
best_offer = fields.Float(
string="Best Offer", compute="_compute_best_offer")
garden_orientation = fields.Selection(
[
('north', "North"),
('south', "South"),
('east', "East"),
('west', "West"),
]
)
active = fields.Boolean(default=True)
state = fields.Selection(
[
('new', "New"),
('offer_received', "Offer Received"),
('offer_accepted', "Offer Accepted"),
('sold', "Sold"),
('canceled', "Canceled"),
],
required=True,
copy=False,
default="new",
)
buyer_id = fields.Many2one(
"res.partner",
string="Buyer",
copy=False,
)
salesperson_id = fields.Many2one(
"res.users",
string="Salesperson",
default=lambda self: self.env.user,
)
property_type_id = fields.Many2one(
"estate.property.type",
string="Property Type",
)
tag_ids = fields.Many2many(
"estate.property.tag",
string="Tags",
)
offer_ids = fields.One2many(
"estate.property.offer",
"property_id",
string="Offer",
)
issue_ids = fields.One2many(
"estate.property.maintenance",
"property_id"
)

_check_expected_price = models.Constraint(
"CHECK(expected_price>0)", "Expected price must be strictly positive"
)

_check_selling_price = models.Constraint(
"CHECK(selling_price>0)", "Selling price must be positive"
)

@api.depends("living_area", "garden_area")
def _compute_total(self):
for record in self:
record.total_area = record.living_area + record.garden_area

@api.depends("offer_ids.price")
def _compute_best_offer(self):
for record in self:
if record.offer_ids:
record.best_offer = max(record.offer_ids.mapped("price"))
else:
record.best_offer = 0

@api.constrains("expected_price", "selling_price")
def _check_selling_price(self):
for record in self:
if float_is_zero(record.selling_price, precision_digits=2):
continue
if (
float_compare(
record.selling_price,
record.expected_price * 0.9,
precision_digits=2,
)
< 0
):
raise ValidationError(
_("Selling price cannot be lower than 90% of the expected price"))

@api.onchange("garden")
def _onchange_garden(self):
if self.garden:
self.garden_area = 10
self.garden_orientation = "north"
else:
self.garden_area = 0
self.garden_orientation = False

@api.ondelete(at_uninstall=False)
def _unlink_check_state(self):
for record in self:
if record.state not in ('new', 'canceled'):
raise UserError(
_("Only New or Cancelled properties can be deleted"))
return True

def action_sold(self):
for record in self:
if record.state == "canceled":
raise UserError(_("Canceled Property cannot be sold"))
record.state = "sold"
return True

def action_cancel(self):
for record in self:
if record.state == "sold":
raise UserError(_("Sold Property cannot be canceled"))
record.state = "canceled"
return True
Loading