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
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 # noqa: F401
19 changes: 19 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Real Estate",
"depends": ["base"],
"application": True,
"installable": True,
"author": "Aditya Maurya",
"license": "LGPL-3",
"category": "Real Estate",
"data": [
"security/ir.model.access.csv",
"views/estate_property_type_views.xml",
"views/estate_property_tag_views.xml",
"views/estate_property_views.xml",
"views/estate_menu.xml",
],
"demo": [
"data/estate_property_demo.xml",
],
}
195 changes: 195 additions & 0 deletions estate/data/estate_property_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Record 1: New House -->
<record id="estate_property_demo_1" model="estate.property">
<field name="name">Cozy Suburban Cottage</field>
<field name="description">A lovely 2-bedroom house with a spacious backyard.</field>
<field name="postcode">90210</field>
<field name="date_availability">2026-09-01</field>
<field name="expected_price">250000</field>
<field name="selling_price">0</field>
<field name="bedrooms">2</field>
<field name="living_area">120</field>
<field name="facades">2</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">50</field>
<field name="garden_orientation">south</field>
<field name="state">new</field>

</record>

<!-- Record 2: Offer Received Apartment -->
<record id="estate_property_demo_2" model="estate.property">
<field name="name">Modern Downtown Apartment</field>
<field name="description">Luxury high-rise unit in the heart of the city.</field>
<field name="postcode">10001</field>
<field name="date_availability">2026-10-15</field>

<field name="expected_price">450000</field>
<field name="selling_price">0</field>
<field name="bedrooms">1</field>
<field name="living_area">75</field>
<field name="facades">1</field>
<field name="garage">False</field>
<field name="garden">False</field>
<field name="state">offer_received</field>

</record>

<!-- Record 3: Sold Villa -->
<record id="estate_property_demo_3" model="estate.property">
<field name="name">Spacious Family Villa</field>
<field name="description">Large villa featuring 5 bedrooms, pool, and huge garden.</field>
<field name="postcode">33101</field>
<field name="date_availability">2026-08-20</field>

<field name="expected_price">850000</field>
<field name="selling_price">830000</field>
<field name="bedrooms">5</field>
<field name="living_area">550</field>
<field name="facades">4</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">200</field>
<field name="garden_orientation">west</field>
<field name="state">sold</field>

</record>

<!-- Record 4: New Penthouse -->
<record id="estate_property_demo_4" model="estate.property">
<field name="name">Luxury Penthouse Suite</field>
<field name="description">Top-floor penthouse with private rooftop terrace.</field>
<field name="postcode">90001</field>
<field name="date_availability">2027-01-15</field>
<field name="expected_price">1200000</field>
<field name="selling_price">0</field>

<field name="bedrooms">3</field>
<field name="living_area">280</field>
<field name="facades">4</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">100</field>
<field name="garden_orientation">west</field>
<field name="state">new</field>

</record>

<!-- Record 5: Offer Accepted House -->
<record id="estate_property_demo_5" model="estate.property">
<field name="name">Suburban Ranch House</field>
<field name="description">Single-story ranch home with a broad front porch.</field>
<field name="postcode">75002</field>
<field name="date_availability">2026-09-10</field>

<field name="expected_price">290000</field>
<field name="selling_price">285000</field>
<field name="bedrooms">3</field>
<field name="living_area">160</field>
<field name="facades">2</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">80</field>
<field name="garden_orientation">east</field>
<field name="state">offer_accepted</field>

</record>

<!-- Record 6: Cancelled / Inactive Studio -->
<record id="estate_property_demo_6" model="estate.property">
<field name="name">Minimalist Urban Loft</field>
<field name="description">Open-concept loft with industrial design elements.</field>
<field name="postcode">60611</field>
<field name="date_availability">2026-10-01</field>
<field name="expected_price">380000</field>
<field name="selling_price">0</field>
<field name="active">False</field>
<field name="bedrooms">1</field>
<field name="living_area">95</field>
<field name="facades">2</field>
<field name="garage">False</field>
<field name="garden">False</field>
<field name="state">cancelled</field>
</record>

<!-- Record 7: Beachfront Condo -->
<record id="estate_property_demo_7" model="estate.property">
<field name="name">Beachfront Condo</field>
<field name="description">Stunning ocean views with private balcony access.</field>
<field name="postcode">33139</field>
<field name="date_availability">2027-03-01</field>
<field name="expected_price">600000</field>
<field name="selling_price">0</field>
<field name="bedrooms">2</field>
<field name="living_area">110</field>
<field name="facades">2</field>
<field name="garage">True</field>
<field name="garden">False</field>
<field name="state">new</field>

</record>

<!-- Record 8: Mountain Chalet -->
<record id="estate_property_demo_8" model="estate.property">
<field name="name">Mountain View Retreat</field>
<field name="description">Peaceful chalet nestled in the mountains.</field>
<field name="postcode">80202</field>
<field name="date_availability">2026-12-01</field>

<field name="expected_price">510000</field>
<field name="selling_price">500000</field>
<field name="bedrooms">3</field>
<field name="living_area">180</field>
<field name="facades">3</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">150</field>
<field name="garden_orientation">north</field>
<field name="state">offer_received</field>

</record>

<!-- Record 9: Historic Townhouse -->
<record id="estate_property_demo_9" model="estate.property">
<field name="name">Historic Townhouse</field>
<field name="description">Classic architecture with modern interior renovations.</field>
<field name="postcode">02108</field>
<field name="date_availability">2026-08-15</field>
<field name="expected_price">720000</field>
<field name="selling_price">0</field>
<field name="bedrooms">3</field>
<field name="living_area">210</field>
<field name="facades">2</field>
<field name="garage">False</field>
<field name="garden">True</field>
<field name="garden_area">40</field>
<field name="garden_orientation">south</field>
<field name="state">new</field>

</record>

<!-- Record 10: Grand Estate Manor -->
<record id="estate_property_demo_10" model="estate.property">
<field name="name">Grand Estate Manor</field>
<field name="description">Massive country estate with extensive living space.</field>
<field name="postcode">75001</field>
<field name="date_availability">2027-02-15</field>
<field name="expected_price">1900000</field>
<field name="selling_price">1850000</field>
<field name="bedrooms">6</field>
<field name="living_area">580</field>
<field name="facades">4</field>
<field name="garage">True</field>
<field name="garden">True</field>
<field name="garden_area">800</field>
<field name="garden_orientation">south</field>
<field name="state">sold</field>
</record>

</data>
</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_property
from . import estate_property_type
from . import estate_property_tag
from . import estate_property_offer
59 changes: 59 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from datetime import datetime

from dateutil.relativedelta import relativedelta
from odoo import fields, models


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

name = fields.Char("Title", required=True)
description = fields.Text("Description")
postcode = fields.Char("Postcode")

def _default_Date(self):
return datetime.now() + relativedelta(months=3)

property_type_id = fields.Many2one("estate.property.type", "Type")
date_availability = fields.Date("Available From", copy=False, default=_default_Date)
expected_price = fields.Float("Expected Price", required=True)
selling_price = fields.Float(
"Selling Price",
readonly=True,
copy=False,
)
sales_man_id = fields.Many2one(
"res.users", string="Salesperson", default=lambda self: self.env.user
)
buyer_id = fields.Many2one("res.partner", string="Buyer")
property_tag_ids = fields.Many2many("estate.property.tag", string="Tags")
property_offer_id = fields.One2many("estate.property.offer", "property_id", "Offer")
active = fields.Boolean(string="Active", default=True)
bedrooms = fields.Integer("Bedrooms", default=2)
living_area = fields.Integer()
facades = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(
[
("north", "North"),
("south", "South"),
("east", "East"),
("west", "West"),
]
)
state = fields.Selection(
[
("new", "New"),
("offer_received", "Offer Received"),
("offer_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
],
string="Status",
required=True,
copy=False,
default="new",
)
13 changes: 13 additions & 0 deletions estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from odoo import fields, models


class PropertyOffer(models.Model):
_name = "estate.property.offer"
_description = "Property Offer for Estate Property"

price = fields.Float("Price", required=True)
status = fields.Selection(
[("accepted", "Accepted"), ("refused", "Refused")], copy=False
)
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 fields, models


class EstatePropertyTag(models.Model):
_name = "estate.property.tag"
_description = "Different Tags for Property"

name = fields.Char("Tag")
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 PropertyType(models.Model):
_name = "estate.property.type"
_description = "Properties 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_system,1,1,1,1
estate.access_estate_porperty_type,access_estate_porperty_type,estate.model_estate_property_type,base.group_system,1,1,1,1
estate.access_estate_porperty_tag,access_estate_porperty_tag,estate.model_estate_property_tag,base.group_system,1,1,1,1
estate.access_estate_porperty_offer,access_estate_porperty_offer,estate.model_estate_property_offer,base.group_system,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.
15 changes: 15 additions & 0 deletions estate/views/estate_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="estate_menu_root" name="Real Estate" web_icon="estate,static/description/icon.png"/>

<menuitem id="estate_advertisement_menuitem" parent="estate_menu_root" name="Advertisement"/>

<menuitem id="estate_property_menuaction" name="properties" parent="estate_advertisement_menuitem" action="estate_property_form_action" />

<menuitem id="estate_property_setting" name="Settings" parent="estate_menu_root"/>

<menuitem id="estate_property_type_menuaction" parent="estate_property_setting" action="estate_property_type_action"/>

<menuitem id="estate_property_tag_menuaction" parent="estate_property_setting" action="estate_property_tag_action"/>

</odoo>
12 changes: 12 additions & 0 deletions estate/views/estate_property_tag_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="estate_property_tag_action" model="ir.actions.act_window">
<field name="name">Properties Tag</field>
<field name="res_model">estate.property.tag</field>
<field name="view_mode">list,form</field>
</record>



</odoo>
23 changes: 23 additions & 0 deletions estate/views/estate_property_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>

<odoo>

<record id="estate_property_type_action" model="ir.actions.act_window">
<field name="name">Properties Type</field>
<field name="res_model">estate.property.type</field>
<field name="view_mode">list,form</field>
</record>

<!-- <record id="estate_property_view_form" model="ir.ui.view">
<field name="name">estate.property.type.form</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<form string="Property Type">

<field name="name"/>

</form>
</field>
</record> -->

</odoo>
Loading