diff --git a/estate/.gitignore b/estate/.gitignore new file mode 100644 index 00000000000..ecc00b7102c --- /dev/null +++ b/estate/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ +*.py[cod] +.vscode \ No newline at end of file diff --git a/estate/__init__.py b/estate/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/estate/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/estate/__manifest__.py b/estate/__manifest__.py new file mode 100644 index 00000000000..ec9d5be1697 --- /dev/null +++ b/estate/__manifest__.py @@ -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", +} diff --git a/estate/demo/estate.property.csv b/estate/demo/estate.property.csv new file mode 100644 index 00000000000..a2608b8aa02 --- /dev/null +++ b/estate/demo/estate.property.csv @@ -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 \ No newline at end of file diff --git a/estate/demo/estate_property_demo.xml b/estate/demo/estate_property_demo.xml new file mode 100644 index 00000000000..5554b74319c --- /dev/null +++ b/estate/demo/estate_property_demo.xml @@ -0,0 +1,61 @@ + + + + + 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 + + + + 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 + + + + 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 + + + diff --git a/estate/models/__init__.py b/estate/models/__init__.py new file mode 100644 index 00000000000..fb25358671b --- /dev/null +++ b/estate/models/__init__.py @@ -0,0 +1,2 @@ +from . import estate_model +from . import estate_property_type diff --git a/estate/models/estate_model.py b/estate/models/estate_model.py new file mode 100644 index 00000000000..5571aec357f --- /dev/null +++ b/estate/models/estate_model.py @@ -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) diff --git a/estate/models/estate_property_type.py b/estate/models/estate_property_type.py new file mode 100644 index 00000000000..232e1cbb125 --- /dev/null +++ b/estate/models/estate_property_type.py @@ -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) diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..622378709a1 --- /dev/null +++ b/estate/security/ir.model.access.csv @@ -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 diff --git a/estate/static/description/icon.png b/estate/static/description/icon.png new file mode 100644 index 00000000000..67922bb3d9a Binary files /dev/null and b/estate/static/description/icon.png differ diff --git a/estate/views/estate_property_root.xml b/estate/views/estate_property_root.xml new file mode 100644 index 00000000000..23bb3987cd0 --- /dev/null +++ b/estate/views/estate_property_root.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/estate/views/estate_property_view.xml b/estate/views/estate_property_view.xml new file mode 100644 index 00000000000..bf7b9e0d880 --- /dev/null +++ b/estate/views/estate_property_view.xml @@ -0,0 +1,109 @@ + + + + + estate.property.list + estate.property + + + + + + + + + + + + + + estate.property.form + estate.property + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + estate.property.search + estate.property + + + + + + + + + + + + + + + + + + + + + + + + Properties + estate.property + list,form + {'search_default_name': "Luxury Villa"} + + + Properties Types + estate.property.type + list,form + +