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
18 changes: 18 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Realest Estate",
"version": "1.0",
"summary": "Manage housing properties",
"category": "Marketing",
"depends": ["base"],
"data": [
"security/ir.model.access.csv",
"demo/estate.property.csv",
"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
61 changes: 61 additions & 0 deletions estate/demo/estate_property_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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>
</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>
</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>
</record>

</odoo>
2 changes: 2 additions & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import estate_model
from . import estate_property_type
56 changes: 56 additions & 0 deletions estate/models/estate_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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,
)
active = fields.Boolean("Active", default=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)
3 changes: 3 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
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
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.
14 changes: 14 additions & 0 deletions estate/views/estate_property_root.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?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" />
</odoo>
109 changes: 109 additions & 0 deletions estate/views/estate_property_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- List View -->
<record id="estate_property_view" model="ir.ui.view">
<field name="name">estate.property.list</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<list decoration-muted="state == 'sold'" editable="top" open_form_view="true">
<field name="name" />
<field name="postcode" />
<field name="date_availability" />
<field name="expected_price" />
<field name="state" />
</list>
</field>
</record>

<!-- Form -->
<record id="estate_property_form" model="ir.ui.view">
<field name="name">estate.property.form</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<form string="estate_property_form">
<sheet>
<group>
<field name="name"/>
</group>
<group>
<group>
<field name="property_type_id" />
<field name="postcode" />
<field name="date_availability" />
</group>
<group>
<field name="expected_price" />
<field name="selling_price" />
</group>
</group>
<notebook>
<page string="Description">
<group>
<field name="description"/>
</group>
<group>
<group >
<field name="bedrooms" />
<field name="living_area" />
<field name="facades" />
<field name="garage" />
<field name="state"/>
<field name="active" invisible="true"/>
</group>
<group>
<field name="garden" />
<field name="garden_area" invisible="not garden" />
<field name="garden_orientation" />
</group>
</group>
</page>
<page name="info" string="Other Info">
<group>
<field name="seller_id" widget="many2one_avatar_user"/>
<field name="buyer_id" widget="many2one_avatar_user" />
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>

<!-- Search -->
<record id="estate_property_search" model="ir.ui.view">
<field name="name">estate.property.search</field>
<field name="model">estate.property</field>

<field name="arch" type="xml">
<search>
<field name="name" />
<field name="postcode" />
<field name="expected_price" />
<field name="bedrooms" />
<field name="living_area" />
<field name="facades" />

<separator/>

<filter name="achieved" string="Achieved" domain="[('active', '=', 'False')]" />
<filter name="garden" string="With Garden" context="{'group_by': 'garden'}" />
<filter name="garage" string="With Garage" context="{'group_by': 'garage'}" />
<filter name="postcode" string="By Postcode" context="{'group_by': 'postcode'}" />
<filter name="state" string="State" domain="['|', ('state', '=', 'new'), ('state','=','o_received')]" />
</search>
</field>
</record>

<!-- Action -->
<record id="estate_property_action" model="ir.actions.act_window">
<field name="name">Properties</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
<field name="context">{'search_default_name': "Luxury Villa"}</field>
</record>
<record id="estate_type_action" model="ir.actions.act_window">
<field name="name">Properties Types</field>
<field name="res_model">estate.property.type</field>
<field name="view_mode">list,form</field>
</record>
</odoo>