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
23 changes: 23 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
'name': 'Real Estate',
'summary': 'Manage real estate properties and offers',
'description': "This module allows managing property advertisements,including property details, offers, and related data.",
'author': 'Sudarshan Maity (sumai)',
'website': '',
'category': 'Real Estate',
'version': '1.0',
'license': 'LGPL-3',

'depends': [
'base',
],

'data': [
'security/ir.model.access.csv',
'views/estate_property_views.xml',
'views/estate_menus.xml',
],

'installable': True,
'application': True,
}
1 change: 1 addition & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import estate_property
52 changes: 52 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from datetime import timedelta

from odoo import models, fields


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

name = fields.Char(string="Title", required=True)
description = fields.Text(string="Description")
postcode = fields.Char(string="Postcode")
date_availability = fields.Date(string="Available From", copy=False, default=lambda self: fields.Date.today() + timedelta(days=90))
expected_price = fields.Float(string="Expected Price", required=True)
selling_price = fields.Float(string="Selling Price", readonly=True,copy=False)
bedrooms = fields.Integer(string="Bedrooms", default=2)
living_area = fields.Integer(string="Living Area (sqm)")
facades = fields.Integer(string="Facades")
garage = fields.Boolean(string="Garage")
garden = fields.Boolean(string="Garden")
garden_area = fields.Integer(string="Garden Area (sqm)")
garden_orientation = fields.Selection(
[
('north', "North"),
('south', "South"),
('east', "East"),
('west', "West"),
],
string="Garden Orientation"
)
active = fields.Boolean(string="is Active", default=True)
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")
swimming_pool = fields.Boolean(string="Swimming Pool") # extra fields
property_type = fields.Selection(
[
('house', "House"),
('apartment', "Apartment"),
('villa', "Villa"),
('land', "Land")
],
string="Property Type"
)
property_age = fields.Integer(string="Property Age")

2 changes: 2 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
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
24 changes: 24 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<odoo>

<!-- Root Menu -->
<menuitem
id="menu_real_estate_root"
name="Real Estate"
sequence="1"/>

<!-- First Level Menu -->
<menuitem
id="menu_real_estate_advertisements"
name="Advertisements"
parent="menu_real_estate_root"
sequence="1"/>

<!-- Second Level Menu -->
<menuitem
id="menu_real_estate_properties"
name="Properties"
parent="menu_real_estate_advertisements"
action="action_estate_property"
sequence="1"/>

</odoo>
9 changes: 9 additions & 0 deletions estate/views/estate_property_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<odoo>

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

</odoo>