diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000000..6457d866cb4 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "python.languageServer": "None", + "python-envs.defaultEnvManager": "ms-python.python:system" +} \ 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..036527b2bf8 --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,14 @@ +{ + "name": "estate", + "depends": ["base"], + "application": True, + "author": "Prathamesh", + "category": "Category", + "description": "This is the estateapp", + "license": "LGPL-3", + "data": [ + "security/ir.model.access.csv", + "views/estate_property_views.xml", + "views/estate_menus.xml", + ], +} diff --git a/estate/models/__init__.py b/estate/models/__init__.py new file mode 100644 index 00000000000..5e1963c9d2f --- /dev/null +++ b/estate/models/__init__.py @@ -0,0 +1 @@ +from . import estate_property diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py new file mode 100644 index 00000000000..0334da147f1 --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,55 @@ +from datetime import timedelta +from odoo import models, fields + + +class EstateProperty(models.Model): + _name = "estate.property" + _description = "Real Estate Property" + + name = fields.Char(required=True) + description = fields.Text() + postcode = fields.Char() + + date_availability = fields.Date( + copy=False, + default=lambda self: fields.Date.today() + timedelta(days=90), + ) + + 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", + ) diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..1ce2e5993fc --- /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,access_estate_property,model_estate_property,base.group_user,1,1,1,1 +,,,,,,, \ No newline at end of file diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml new file mode 100644 index 00000000000..e045dfcd8a4 --- /dev/null +++ b/estate/views/estate_menus.xml @@ -0,0 +1,19 @@ + + + + + + + + + + diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml new file mode 100644 index 00000000000..5451f584625 --- /dev/null +++ b/estate/views/estate_property_views.xml @@ -0,0 +1,91 @@ + + + + + + estate.property.list + estate.property + + + + + + + + + + + + + + + + + estate.property.form + estate.property + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + estate.property.search + estate.property + + + + + + + + + + + + + + + + + Properties + estate.property + list,form + + +