Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions estate/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__pycache__/
*.py[cod]
.vscode
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
20 changes: 20 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Realest Estate",
"version": "1.0",
"summary": "Manage housing properties",
"category": "Marketing",
"depends": ["base"],
"data": [
"security/ir.model.access.csv",
"demo/estate_property_tags_demo.xml",
"demo/estate_property_types_demo.xml",
"demo/estate_property_demo.xml",
"views/estate_property_view.xml",
"views/estate_property_root.xml",
],
"demo": [],
"application": True,
"installable": True,
"license": "LGPL-3",
"author": "Smit Patel",
}
4 changes: 4 additions & 0 deletions estate/demo/estate.property.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,name,description,postcode,date_availability,expected_price,selling_price,bedrooms,living_area,facades,garage,garden,garden_area,garden_orientation,state
estate_property_demo_1,Luxury Villa,"Spacious luxury villa with a private swimming pool, landscaped garden, and modern interiors.",560001,2026-09-15,1250000.00,0.00,5,320,4,True,True,180,south,o_received
estate_property_demo_2,Modern Apartment,"Elegant apartment located in the city center with a balcony and dedicated parking.",110001,2026-10-01,480000.00,0.00,2,95,2,True,False,0,north,new
estate_property_demo_3,Cozy Country Cottage,"Charming countryside cottage surrounded by greenery, ideal for a peaceful family lifestyle.",411001,2026-08-20,650000.00,0.00,3,170,3,False,True,250,east,sold
82 changes: 82 additions & 0 deletions estate/demo/estate_property_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="estate_property_demo_1" model="estate.property">
<field name="name">Luxury Villa</field>
<field name="description">
Spacious luxury villa with a private swimming pool, landscaped garden, and modern interiors.
</field>
<field name="postcode">560001</field>
<field name="date_availability">2026-09-15</field>
<field name="expected_price">1250000.00</field>
<field name="selling_price">0.00</field>
<field name="bedrooms">5</field>
<field name="living_area">320</field>
<field name="facades">4</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">180</field>
<field name="garden_orientation">south</field>
<field name="state">o_received</field>
<field name="property_type_id" ref="type_mansion" />
<field name="tags_ids" eval="[
Command.set([
ref('tag_spacious'),
ref('tag_luxury'),
])
]" />
</record>

<record id="estate_property_demo_2" model="estate.property">
<field name="name">Modern Apartment</field>
<field name="description">
Elegant apartment located in the city center with a balcony and dedicated parking.
</field>
<field name="postcode">110001</field>
<field name="date_availability">2026-10-01</field>
<field name="expected_price">480000.00</field>
<field name="selling_price">0.00</field>
<field name="bedrooms">2</field>
<field name="living_area">95</field>
<field name="facades">2</field>
<field name="garage">True</field>
<field name="garden">False</field>
<field name="garden_area">0</field>
<field name="garden_orientation">north</field>
<field name="state">new</field>
<field name="property_type_id" ref="type_house" />
<field name="tags_ids" eval="[
Command.set([
ref('tag_compact'),
ref('tag_renovated'),
])
]" />
</record>

<record id="estate_property_demo_3" model="estate.property">
<field name="name">Cozy Country Cottage</field>
<field name="description">
Charming countryside cottage surrounded by greenery, ideal for a peaceful family lifestyle.
</field>
<field name="postcode">411001</field>
<field name="date_availability">2026-08-20</field>
<field name="expected_price">650000.00</field>
<field name="selling_price">0.00</field>
<field name="bedrooms">3</field>
<field name="living_area">170</field>
<field name="facades">3</field>
<field name="garage">False</field>
<field name="garden">True</field>
<field name="garden_area">250</field>
<field name="garden_orientation">east</field>
<field name="state">sold</field>
<field name="property_type_id" ref="type_hotel" />
<field name="tags_ids" eval="[
Command.set([
ref('tag_cozy'),
ref('tag_maintenance'),
])
]" />
</record>

</odoo>
28 changes: 28 additions & 0 deletions estate/demo/estate_property_tags_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="tag_spacious" model="estate.property.tag">
<field name="name">Spacious</field>
</record>

<record id="tag_luxury" model="estate.property.tag">
<field name="name">Luxury</field>
</record>

<record id="tag_compact" model="estate.property.tag">
<field name="name">Compact</field>
</record>

<record id="tag_renovated" model="estate.property.tag">
<field name="name">Renovated</field>
</record>

<record id="tag_cozy" model="estate.property.tag">
<field name="name">Cozy</field>
</record>

<record id="tag_maintenance" model="estate.property.tag">
<field name="name">Maintenance</field>
</record>

</odoo>
28 changes: 28 additions & 0 deletions estate/demo/estate_property_types_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>

<record id="type_house" model="estate.property.type">
<field name="name">House</field>
</record>

<record id="type_villa" model="estate.property.type">
<field name="name">Villa</field>
</record>

<record id="type_mansion" model="estate.property.type">
<field name="name">Mansion</field>
</record>

<record id="type_flat" model="estate.property.type">
<field name="name">Flat</field>
</record>

<record id="type_apartment" model="estate.property.type">
<field name="name">Apartment</field>
</record>

<record id="type_hotel" model="estate.property.type">
<field name="name">Hotel</field>
</record>

</odoo>
4 changes: 4 additions & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import estate_model
from . import estate_property_type
from . import estate_property_tag
from . import estate_property_offer
58 changes: 58 additions & 0 deletions estate/models/estate_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from odoo import fields, models
from datetime import timedelta


class EstateProperty(models.Model):
_name = "estate.property"
_description = "This is a Estate property model containing all the data associated with housing."

_auto = True
_log_access = False
# _table = "estate.property

name = fields.Char(string="Name", required=True, index=True)
description = fields.Text("Description")
postcode = fields.Char("Postcode")
date_availability = fields.Date(
"Available From", copy=False, default=fields.Date.today() + timedelta(days=90)
)
expected_price = fields.Float("Expected Price", required=False)
selling_price = fields.Float("Selling Price", readonly=True, copy=False)
bedrooms = fields.Integer("Total Bedrooms", default=2)
living_area = fields.Integer("Living Area (sqm)")
facades = fields.Integer("Facades")
garage = fields.Boolean("Garage")
garden = fields.Boolean("Garden")
garden_area = fields.Integer("Garden Area (sqms)")
garden_orientation = fields.Selection(
string="Orientation",
selection=[
("north", "North"),
("south", "South"),
("west", "West"),
("east", "East"),
],
help="Type is used to get the garden orientation in a specific direction",
)
state = fields.Selection(
string="State",
selection=[
("new", "New"),
("o_received", "Offer Received"),
("o_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
],
copy=False,
default="new",
)
property_type_id = fields.Many2one("estate.property.type", "Type")
buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False)
seller_id = fields.Many2one(
"res.users",
string="Salesperson",
default=lambda self: self.env.user,
)
tags_ids = fields.Many2many("estate.property.tag", "Tag")
offer_ids = fields.One2many("estate.property.offer", "property_id", string="Offers")
active = fields.Boolean("Active", default=True)
15 changes: 15 additions & 0 deletions estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from odoo import fields, models


class EstatePropertyOffer(models.Model):
_name = "estate.property.offer"
_description = "this model defines offers"

price = fields.Float(string="Price")
status = fields.Selection(
selection=[("accepted", "Accepted"), ("refused", "Refused")],
copy=False,
string="Status",
)
partner_id = fields.Many2one("res.partner", required=True)
property_id = fields.Many2one("estate.property", required=True)
8 changes: 8 additions & 0 deletions estate/models/estate_property_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import models, fields


class EstatePropertyTag(models.Model):
_name = "estate.property.tag"
_description = "this model defines property tags"

name = fields.Char("Tag", required=True)
8 changes: 8 additions & 0 deletions estate/models/estate_property_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class EstatePropertyType(models.Model):
_name = "estate.property.type"
_description = "this model defines property type"

name = fields.Char("Type", required=True)
5 changes: 5 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property,estate.property,model_estate_property,base.group_user,1,1,1,1
access_estate_property_type,estate.property.type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tag,estate.property.tag,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_property_offer,estate.property.offer,model_estate_property_offer,base.group_user,1,1,1,1
Binary file added estate/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions estate/views/estate_property_root.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Root Menu -->
<menuitem id="estate_menu_root" name="Realest Estate" sequence="1" web_icon="estate,static/description/icon.png" />

<!-- Estate Menu -->
<menuitem id="estate_menu_estates_property" name="My Estates" parent="estate_menu_root" sequence="1" action="estate_property_action" />

<!-- Setting Menu -->
<menuitem id="estate_menu_estates_settings" name="Settings" parent="estate_menu_root" sequence="2" />

<!-- Property Types Menu -->
<menuitem id="estate_menu_estates_property_type" name="Property Types" parent="estate_menu_estates_settings" action="estate_type_action" />

<!-- Property Tags Menu -->
<menuitem id="estate_menu_estates_property_tag" name="Property Tags" parent="estate_menu_estates_settings" action="estate_tag_action" />
</odoo>
Loading