Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d8e656e
[ADD] estate: add real estate advertisement module structure
risri-odoo Jun 4, 2026
5562495
[ADD] estate: add EstateProperty model with basic fields
risri-odoo Jun 8, 2026
b09ba24
[IMP] estate: add missing string attribute to garden_area field
risri-odoo Jun 8, 2026
77f6693
[IMP] estate: fixed files based on codingguidelines
risri-odoo Jun 8, 2026
2b2fe10
[IMP] estate: fixed files based on codingguidelines
risri-odoo Jun 8, 2026
55c355b
[ADD] estate: add access rights for estate.property model
risri-odoo Jun 8, 2026
9440c91
[IMP] estate: Fixed the issue inside estate/manifest.py
risri-odoo Jun 8, 2026
2d7d1d3
[ADD] estate: add views, menus, feild attributes and reserved fields
risri-odoo Jun 9, 2026
8f4806a
[IMP] estate: edited estate_property.py for check-style issue
risri-odoo Jun 10, 2026
9d071e5
[ADD] estate: added list, form, search and domain view
risri-odoo Jun 15, 2026
7ea10bd
[IMP] estate: added list, form, search and domain view and check-styl…
risri-odoo Jun 15, 2026
b94b24f
[ADD] estate: add property type, tags and many2one fields
risri-odoo Jun 22, 2026
2306fe7
[IMP] estate: fixed check style issues and removed authore and licens…
risri-odoo Jun 22, 2026
4c15657
[IMP] estate: fixed check style issues and removed authore and licens…
risri-odoo Jun 22, 2026
4a471f6
[ADD] estate: added sample data of properties, property tags, propert…
risri-odoo Jun 22, 2026
7c50ad8
[ADD] estate: added sample data of properties, property tags, propert…
risri-odoo Jun 22, 2026
0f8cd5d
[ADD] estate: added sample data of properties, property tags, propert…
risri-odoo Jun 22, 2026
f2b988c
[IMP] estate: added sample data of properties, property tags, propert…
risri-odoo Jun 22, 2026
924a839
[IMP] estate: improved some of the check-style issues pointed by our …
risri-odoo Jun 23, 2026
b87c883
[IMP] estate: improved some of the check-style issues pointed by our …
risri-odoo Jun 23, 2026
635c2b2
[ADD] estate: added one2many feild of chapter 7.3
risri-odoo Jun 24, 2026
566586c
[IMP] estate: correction of check-style of one2many feild and propert…
risri-odoo Jun 24, 2026
1f4df3a
[IMP] estate: correction of check-style of one2many feild and propert…
risri-odoo Jun 24, 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
3 changes: 3 additions & 0 deletions estate/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.languageServer": "None"
}
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
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',
'author': 'Odoo S.A',
'license': 'LGPL-3',
'depends': ['base'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the purpose of depends?

'application': True,
'data': [
'security/ir.model.access.csv',
'views/estate_property_views.xml',
'views/estate_property_type_views.xml',
'views/estate_property_tags_views.xml',
'views/estate_menus.xml',
],
'demo': [
'demo/estate_property_type_demo.xml',
'demo/estate_property_tag_demo.xml',
'demo/estate_property_demo.xml',
]
}
69 changes: 69 additions & 0 deletions estate/demo/estate_property_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--Properties-->

<record id="estate_property_1" model="estate.property">
<field name="name">Rohtas Plumeria</field>
<field name="description">3bhk appts</field>
<field name="postcode">226010</field>
<field name="date_availability" eval="(datetime.today() + relativedelta(months=3)).strftime('%Y-%m-%d')"/>
<field name="expected_price">7500000</field>
<field name="selling_price">0</field>
<field name="bedrooms">3</field>
<field name="living_area">1800</field>
<field name="facades">3</field>
<field name="garage" eval="False"/>
<field name="garden" eval="False"/>
<field name="property_type_id" ref="property_type_appartment"/>
<field name="tag_ids" eval="[(4,ref('property_tags_cozy'))]"/>
</record>

<record id="estate_property_2" model="estate.property">
<field name="name">Gkb Grace</field>
<field name="description">3bhk appts</field>
<field name="postcode">336010</field>
<field name="date_availability" eval="(datetime.today() + relativedelta(months=3)).strftime('%Y-%m-%d')"/>
<field name="expected_price">5000000</field>
<field name="selling_price">0</field>
<field name="bedrooms">3</field>
<field name="living_area">1600</field>
<field name="facades">3</field>
<field name="garage" eval="False"/>
<field name="garden" eval="False"/>
<field name="property_type_id" ref="property_type_penthouse"/>
<field name="tag_ids" eval="[(4,ref('property_tags_renovated'))]"/>
</record>

<record id="estate_property_3" model="estate.property">
<field name="name">omaxe heights</field>
<field name="description">5bhk appts</field>
<field name="postcode">226010</field>
<field name="date_availability" eval="(datetime.today() + relativedelta(months=3)).strftime('%Y-%m-%d')"/>
<field name="expected_price">8500000</field>
<field name="selling_price">0</field>
<field name="bedrooms">5</field>
<field name="living_area">2400</field>
<field name="facades">4</field>
<field name="garage" eval="False"/>
<field name="garden" eval="False"/>
<field name="property_type_id" ref="property_type_villa"/>
<field name="tag_ids" eval="[(4,ref('property_tags_furnished'))]"/>
</record>

<record id="estate_property_4" model="estate.property">
<field name="name">parsvanath planet</field>
<field name="description">2bhk appts</field>
<field name="postcode">226016</field>
<field name="date_availability" eval="(datetime.today() + relativedelta(months=3)).strftime('%Y-%m-%d')"/>
<field name="expected_price">4500000</field>
<field name="selling_price">0</field>
<field name="bedrooms">2</field>
<field name="living_area">1400</field>
<field name="facades">4</field>
<field name="garage" eval="False"/>
<field name="garden" eval="False"/>
<field name="property_type_id" ref="property_type_villa"/>
<field name="tag_ids" eval="[(4,ref('property_tags_new'))]"/>
</record>
</odoo>

21 changes: 21 additions & 0 deletions estate/demo/estate_property_tag_demo.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="property_tags_cozy" model="estate.property.tag">
<field name="name">cozy</field>
</record>
<record id="property_tags_furnished" model="estate.property.tag">
<field name="name">furnished</field>
</record>
<record id="property_tags_unfurnished" model="estate.property.tag">
<field name="name">unfurnished</field>
</record>
<record id="property_tags_renovated" model="estate.property.tag">
<field name="name">renovated</field>
</record>
<record id="property_tags_new" model="estate.property.tag">
<field name="name">new</field>
</record>
<record id="property_tags_old_property" model="estate.property.tag">
<field name="name">old property</field>
</record>
</odoo>
21 changes: 21 additions & 0 deletions estate/demo/estate_property_type_demo.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="property_type_house" model="estate.property.type">
<field name="name">house</field>
</record>
<record id="property_type_appartment" model="estate.property.type">
<field name="name">appartment</field>
</record>
<record id="property_type_penthouse" model="estate.property.type">
<field name="name">penthouse</field>
</record>
<record id="property_type_villa" model="estate.property.type">
<field name="name">villa</field>
</record>
<record id="property_type_duplex" model="estate.property.type">
<field name="name">duplex</field>
</record>
<record id="property_type_studio" model="estate.property.type">
<field name="name">studio</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
55 changes: 55 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from odoo import api, fields, models
from dateutil.relativedelta import relativedelta


class EstateProperty(models.Model):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why have you used here models.Model?

_name = "estate.property"
_description = "Real Estate Property"

name = fields.Char(string="Name", required=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If the string is similar to the field name, then you can skip adding the string as it will automatically take the name from the field directly. You can apply it everywhere

description = fields.Text(string="Description")
postcode = fields.Char(string="Postcode")
date_availability = fields.Date(copy=False, default=lambda self: fields.Date.today() + relativedelta(months=3), string="Availability Date")
expected_price = fields.Float(string="Expected Price", required=True)
selling_price = fields.Float(readonly=True, copy=False, string="Selling Price")
bedrooms = fields.Integer(default=2, string="Bedrooms")
living_area = fields.Integer(string="Living Area")
facades = fields.Integer(string="Facades")
garage = fields.Boolean(string="Garage")
garden = fields.Boolean(string="Garden")
garden_area = fields.Integer(string="Garden Area")
active = fields.Boolean(default=True, string="Active")
state = fields.Selection(
selection=[
('new', "New"),
('offer_received', "Offer Received"),
('offer_accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled"),
],
required=True,
copy=False,
default='new',
string="State"
)
garden_orientation = fields.Selection(
selection=[
('north', 'North'),
('south', 'South'),
('east', 'East'),
('west', 'West'),
],
string="Garden Orientation"
)
total_area = fields.Integer(string="Total Area", compute="_compute_total_area")

@api.depends('living_area', 'garden_area')
def _compute_total_area(self):
# breakpoint()
for record in self:
record.total_area = record.living_area + record.garden_area
property_type_id = fields.Many2one("estate.property.type", string="Property Type")
buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False)
salesperson_id = fields.Many2one("res.users", default=lambda self: self.env.user, string="Salesperson")
tag_ids = fields.Many2many("estate.property.tag", string="Tags")
offer_id = fields.One2many("estate.property.offer", "property_id", string="Offers")
19 changes: 19 additions & 0 deletions estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from odoo import fields, models


class EstatePropertyOffer(models.Model):

_name = "estate.property.offer"
_description = "Estate Property Offer"

price = fields.Float(string="Price")
status = fields.Selection(
selection=[
('Accepted', "Accepted"),
('Refused', "Refused"),
],
string="Status",
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(string="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 = "Real Estate Property Types"

name = fields.Char(string="Name", 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
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.
33 changes: 33 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem
id="estate_menu_root" name="Real Estate"
web_icon="estate,static/description/icon.png">
</menuitem>
Comment on lines +3 to +6

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
<menuitem
id="estate_menu_root" name="Real Estate"
web_icon="estate,static/description/icon.png">
</menuitem>
<menuitem
id="estate_menu_root"
name="Real Estate"
web_icon="estate,static/description/icon.png">
</menuitem>

<menuitem id="estate_first_level_menu"
name="Advertisements"
parent="estate.estate_menu_root"
/>
<menuitem
id="estate_settings_menu"
name="Settings"
parent="estate.estate_menu_root"
/>
<menuitem
id="estate_property_menu_action"
name="Properties"
parent="estate.estate_first_level_menu"
action="estate_property_action"
/>
<menuitem
id="estate_property_type_menu"
name="Property Types"
parent="estate_settings_menu"
action="estate_property_type_action"
/>
<menuitem
id="estate_property_tag_menu"
name="Property Tags"
parent="estate_settings_menu"
action="estate_property_tag_action"/>
</odoo>
35 changes: 35 additions & 0 deletions estate/views/estate_property_tags_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<odoo>
<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>
<record id="estate_property_tag_list" model="ir.ui.view">
<field name="name">estate.property.tags.list</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<list string="Properties">
<field name="name"/>
</list>
</field>
</record>
<record id="estate_property_tags_form" model="ir.ui.view">
<field name="name">estate.property.tags.form</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<form>
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
</group>
</sheet>
</form>
</field>
</record>


</odoo>
58 changes: 58 additions & 0 deletions estate/views/estate_property_type_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<odoo>
<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,kanban</field>
</record>

<record id="estate_property_type_list" 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 string="Properties">
<field name="name"/>
</list>
</field>
</record>

<!-- <record id="estate_property_type_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>
<sheet>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name=""/>
<field name="Postcode"/>
<field name="Available Form"/>
</group>
<group>
<field name="Expected Price"/>
<field name="Selling Price"/>
</group>
</group>
<notebook>
<page string ="description"/>

<field name=""/>
<group>
<group>
<field name="Salesperson"/>
<field name="Buyer"/>
</group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record> -->


</odoo>
Loading