Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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': [
Comment thread
sumai-odoo marked this conversation as resolved.
'base',
],

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

'installable': True,
Comment thread
sumai-odoo marked this conversation as resolved.
'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
51 changes: 51 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from datetime import timedelta

from odoo import models, fields


class EstateProperty(models.Model):
Comment thread
sumai-odoo marked this conversation as resolved.
_name = 'estate.property'
_description = 'Real Estate Property'

name = fields.Char(string="Title", required=True)
description = fields.Text(string="Description")
postcode = fields.Char(string="Postcode")
Comment thread
sumai-odoo marked this conversation as resolved.
Outdated
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)", copy=False)
facades = fields.Integer(string="Facades")
garage = fields.Boolean(string="Garage")
garden = fields.Boolean(string="Garden")
Comment thread
sumai-odoo marked this conversation as resolved.
Outdated
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")
Comment thread
sumai-odoo marked this conversation as resolved.
Outdated
swimming_pool = fields.Boolean(string="Swimming Pool") # extra fields
property_type = fields.Selection(
[
('house', "House"),
('apartment', "Apartment"),
('villa', "Villa"),
('land', "Land")
],
string="Property Type"
)
Comment thread
sumai-odoo marked this conversation as resolved.
Outdated
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"/>
Comment thread
sumai-odoo marked this conversation as resolved.

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

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

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

<field name="name"/>
<field name="postcode"/>
<field name="bedrooms"/>
<field name="living_area"/>
<field name="expected_price"/>
<field name="selling_price"/>
<field name="date_availability"/>
<field name="property_type"/>

</list>
</field>
</record>

<record id="view_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="Property">
<sheet>
<group>
<group>
<field name="name"/>
<field name="postcode"/>
<field name="date_availability"/>
</group>
<group>
<field name="expected_price"/>
<field name="selling_price"/>
</group>
</group>
<notebook>
<page string="Description">
<field name="description"/>
</page>
<page string="Details">
<group>
<group>
<field name="bedrooms"/>
<field name="living_area"/>
<field name="facades"/>
<field name="garage"/>
</group>
<group>
<field name="garden"/>
<field name="garden_area"/>
<field name="garden_orientation"/>
</group>
</group>
</page>
<page string="Extra Details">
<group>
<group>
<field name="state"/>
<field name="property_age"/>
<field name="property_type"/>
</group>
<group>
<field name="swimming_pool"/>
<field name="active"/>
</group>
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>

</odoo>