From 458d9300e7f0c8ece3dcfa2faca66b2e3ad9451b Mon Sep 17 00:00:00 2001 From: hatiw-odoo Date: Tue, 9 Dec 2025 10:34:40 +0530 Subject: [PATCH 1/2] [ADD] estate: Architecture, app, models, security MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chapter 2 – Created the base structure for a new custom Odoo application. Chapter 3 – Implemented primary models with essential fields and basic logic. Chapter 4 – Added ACLs and basic security rules for controlled data access. --- estate/__init__.py | 1 + estate/__manifest__.py | 17 +++++++++++++ estate/models/__init__.py | 1 + estate/models/estate_property.py | 20 +++++++++++++++ estate/security/ir.model.access.csv | 2 ++ estate/views/estate_menus.xml | 15 ++++++++++++ estate/views/estate_property_views.xml | 34 ++++++++++++++++++++++++++ 7 files changed, 90 insertions(+) create mode 100644 estate/__init__.py create mode 100644 estate/__manifest__.py create mode 100644 estate/models/__init__.py create mode 100644 estate/models/estate_property.py create mode 100644 estate/security/ir.model.access.csv create mode 100644 estate/views/estate_menus.xml create mode 100644 estate/views/estate_property_views.xml 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..9fa25052a47 --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,17 @@ +{ + 'name': "Real Estate", + 'version': '1.0', + 'depends': ['base'], + 'author': "Harsh Tiwari", + 'category': 'Category', + 'application': True, + 'description': """ + Description text + """, + 'license': 'LGPL-3', + 'data': [ + 'views/estate_menus.xml', + 'views/estate_property_views.xml', + 'security/ir.model.access.csv' + ] +} 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..6a0d4da4907 --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,20 @@ +from odoo import models, fields + + +class EstateProperty(models.Model): + _name = "estate.property" + _description = "Estate Property" + + name = fields.Char(required=True) + description = fields.Text() + postcode = fields.Char() + date_avaliability = fields.Date() + expected_price = fields.Float(required=True) + selling_price = fields.Float() + bedrooms = fields.Integer() + living_area = fields.Integer() + facades = fields.Integer() + garage = fields.Boolean() + garden = fields.Boolean() + garden_area = fields.Integer() + garden_orientation = fields.Selection(selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')]) diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..5bbdfb3a2a9 --- /dev/null +++ b/estate/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"estate.access_estate_property","access_estate_property","estate.model_estate_property","base.group_user",1,0,0,0 \ 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..48efdc00629 --- /dev/null +++ b/estate/views/estate_menus.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml new file mode 100644 index 00000000000..80d894f0cf5 --- /dev/null +++ b/estate/views/estate_property_views.xml @@ -0,0 +1,34 @@ + + + Estate Property + estate.property + list,form + +

+ Estate Property Home! +

+
+
+ + + Estate Property + estate.property + list,form + +

+ Create New Property! +

+
+
+ + + Estate Property + estate.property + list,form + +

+ Empty! +

+
+
+
\ No newline at end of file From 1fd9b0b92f738370866a4b032ba671410bd6facf Mon Sep 17 00:00:00 2001 From: hatiw-odoo Date: Tue, 9 Dec 2025 10:41:08 +0530 Subject: [PATCH 2/2] [ADD] estate: Add UI components (menus, views, actions) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chapter 5 – Built initial UI components including menus, views, and actions. --- estate/__manifest__.py | 8 ++++---- estate/security/ir.model.access.csv | 2 +- estate/views/estate_menus.xml | 2 +- estate/views/estate_property_views.xml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 9fa25052a47..16636c88bd4 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -1,8 +1,8 @@ { - 'name': "Real Estate", + 'name': 'Real Estate', 'version': '1.0', 'depends': ['base'], - 'author': "Harsh Tiwari", + 'author': 'Harsh Tiwari', 'category': 'Category', 'application': True, 'description': """ @@ -10,8 +10,8 @@ """, 'license': 'LGPL-3', 'data': [ - 'views/estate_menus.xml', 'views/estate_property_views.xml', - 'security/ir.model.access.csv' + 'security/ir.model.access.csv', + 'views/estate_menus.xml', ] } diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv index 5bbdfb3a2a9..bb09389bbe7 100644 --- a/estate/security/ir.model.access.csv +++ b/estate/security/ir.model.access.csv @@ -1,2 +1,2 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"estate.access_estate_property","access_estate_property","estate.model_estate_property","base.group_user",1,0,0,0 \ No newline at end of file +"estate.access_estate_property","access_estate_property","estate.model_estate_property","base.group_user",1,1,1,1 diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml index 48efdc00629..9f702a1dfe6 100644 --- a/estate/views/estate_menus.xml +++ b/estate/views/estate_menus.xml @@ -12,4 +12,4 @@ name="Configuration" parent="estate_menu_root" action="action_estate_configure" /> - \ No newline at end of file + diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml index 80d894f0cf5..da5dea65c2b 100644 --- a/estate/views/estate_property_views.xml +++ b/estate/views/estate_property_views.xml @@ -31,4 +31,4 @@

- \ No newline at end of file +