Skip to content
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
16 changes: 16 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
'name': 'Real Estate',
'depends': ['base'],
'application': True,
'data': [
'security/ir.model.access.csv',
'views/estate_property_views.xml',
'views/estate_property_type_views.xml',
'views/estate_property_tag_views.xml',
'views/estate_property_offer_views.xml',
'views/estate_menus.xml',
'data/data_type.xml',
'data/data_tags.xml',
'data/data.xml',
],
}
40 changes: 40 additions & 0 deletions estate/data/data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="estate_property_list_view_demo_1" model="estate.property">
<field name="name">ABC Ltd</field>
<field name="property_type_id" ref="estate_property_type_1"/>
<field name="tag_ids" eval="[(6, 0, [ref('estate_property_tag_1')])]"/>
<field name="postcode">123345</field>
<field name="bedrooms">2</field>
<field name="living_area">135765</field>
<field name="expected_price">256000</field>
<field name="selling_price">2345678</field>
<field name="date_availability">2026-06-20</field>
</record>

<record id="estate_property_list_view_demo_2" model="estate.property">
<field name="name">XYZ Pvt Ltd</field>
<field name="property_type_id" ref="estate_property_type_2"/>
<field name="tag_ids" eval="[(6, 0, [ref('estate_property_tag_1')])]"/>
<field name="postcode">7865445</field>
<field name="bedrooms">4</field>
<field name="living_area">100000</field>
<field name="expected_price">200000</field>
<field name="selling_price">500000</field>
<field name="date_availability">2026-09-30</field>
</record>

<record id="estate_property_list_view_demo_3" model="estate.property">
<field name="name">Umbrella Corp</field>
<field name="property_type_id" ref="estate_property_type_4"/>
<field name="tag_ids" eval="[(6, 0, [ref('estate_property_tag_3')])]"/>
<field name="postcode">908765</field>
<field name="bedrooms">3</field>
<field name="living_area">100000</field>
<field name="expected_price">700000</field>
<field name="selling_price">800000</field>
<field name="date_availability">2026-09-30</field>
</record>

</odoo>
18 changes: 18 additions & 0 deletions estate/data/data_tags.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="estate_property_tag_1" model="estate.property.tag">
<field name="name">Cozy</field>
</record>
<record id="estate_property_tag_2" model="estate.property.tag">
<field name="name">Furnished</field>
</record>
<record id="estate_property_tag_3" model="estate.property.tag">
<field name="name">Renovated</field>
</record>
<record id="estate_property_tag_4" model="estate.property.tag">
<field name="name">Unfurnished</field>
</record>
<record id="estate_property_tag_5" model="estate.property.tag">
<field name="name">Semi-furnished</field>
</record>
</odoo>
21 changes: 21 additions & 0 deletions estate/data/data_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="estate_property_type_1" model="estate.property.type">
<field name="name">House</field>
</record>
<record id="estate_property_type_2" model="estate.property.type">
<field name="name">Apartment</field>
</record>
<record id="estate_property_type_3" model="estate.property.type">
<field name="name">Penthouse</field>
</record>
<record id="estate_property_type_4" model="estate.property.type">
<field name="name">Villa</field>
</record>
<record id="estate_property_type_5" model="estate.property.type">
<field name="name">Boat House</field>
</record>
<record id="estate_property_type_6" model="estate.property.type">
<field name="name">Mansion</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_property
from . import estate_property_type
from . import estate_property_tag
from . import estate_property_offer
76 changes: 76 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
from datetime import timedelta

from odoo import fields, models


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

def _default_availability_date(self):
return fields.Date.today() + timedelta(days=90)

name = fields.Char(required=True)
description = fields.Text()
postcode = fields.Char()
property_type_id = fields.Many2one(
"estate.property.type",
string="Property Type",
)
tag_ids = fields.Many2many(
"estate.property.tag",
string="Tags",
)
buyer_id = fields.Many2one(
"res.partner",
string="Buyer",
copy=False,
)
salesperson_id = fields.Many2one(
"res.users",
string="Salesperson",
default=lambda self: self.env.user,
)
offer_ids = fields.One2many(
"estate.property.offer",
"property_id",
string="Offers",
)
date_availability = fields.Date(
copy=False,
default=_default_availability_date,
)
expected_price = fields.Float(required=True)
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()
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'),
('cancelled', 'Cancelled'),
],
required=True,
copy=False,
default='new',
)
25 changes: 25 additions & 0 deletions estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from odoo import fields, models

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

price = fields.Float()

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 = "Real Estate Property Tag"

name = fields.Char(required=True)

7 changes: 7 additions & 0 deletions estate/models/estate_property_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from odoo import fields, models

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

name = fields.Char(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,access_estate_property,model_estate_property,base.group_user,1,1,1,1
access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1
41 changes: 41 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<menuitem
id="estate_menu_root"
name="Real Estate"
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneccary diff.

<menuitem
id="estate_advertisements_menu"
name="Advertisements"
parent="estate_menu_root"
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneccary diff.

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

<menuitem
id="estate_property_type_menu_action"
name="Property Types"
parent="estate_settings_menu"
action="estate_property_type_action"
/>

<menuitem
id="estate_property_tag_menu_action"
name="Property Tags"
parent="estate_settings_menu"
action="estate_property_tag_action"
/>

<menuitem
id="estate_property_menu_action"
parent="estate_advertisements_menu"
action="estate_property_action"
/>

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

<record id="estate_property_offer_list_view" model="ir.ui.view">
<field name="name">estate.property.offer.list</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<list>
<field name="price"/>
<field name="partner_id"/>
<field name="status"/>
</list>
</field>
</record>

<record id="estate_property_offer_form_view" model="ir.ui.view">
<field name="name">estate.property.offer.form</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="price"/>
<field name="partner_id"/>
<field name="status"/>
</group>
</sheet>
</form>
</field>
</record>

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

<record id="estate_property_tag_list_view" model="ir.ui.view">
<field name="name">estate.property.tag.list</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<list>
<field name="name"/>
</list>
</field>
</record>

<record id="estate_property_tag_form_view" model="ir.ui.view">
<field name="name">estate.property.tag.form</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
</form>
</field>
</record>

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

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

<record id="estate_property_type_list_view" model="ir.ui.view">
<field name="name">estate.property.type.list</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<list>
<field name="name"/>
</list>
</field>
</record>

<record id="estate_property_type_form_view" 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>
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
</form>
</field>
</record>

<record id="estate_property_type_action" model="ir.actions.act_window">
<field name="name">Property Types</field>
<field name="res_model">estate.property.type</field>
<field name="view_mode">list,form</field>
</record>
</odoo>
Loading