From ef3fde4a2ff7a4ca0d0ac5964f432906ea53e553 Mon Sep 17 00:00:00 2001 From: habar Date: Tue, 10 Mar 2026 19:06:07 +0530 Subject: [PATCH 1/9] [ADD] estate:estate module creation and model implementation.1.Configured manifest with required metadata. 2.Covers chapter 2 and 3. 3.Added all the required fields & attributes. --- estate/__init__.py | 1 + estate/__manifest__.py | 11 +++++++++++ estate/models/__init__.py | 1 + estate/models/estate_property.py | 24 ++++++++++++++++++++++++ 4 files changed, 37 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 diff --git a/estate/__init__.py b/estate/__init__.py new file mode 100644 index 00000000000..9a7e03eded3 --- /dev/null +++ b/estate/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/estate/__manifest__.py b/estate/__manifest__.py new file mode 100644 index 00000000000..f29ccaf8e52 --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,11 @@ +{ + 'name': "estate", + 'version': '1.0', + 'depends': ['base'], + 'author': "Harshvardhan", + 'category': 'Category', + 'description': """ + This is the sample module for practise + """, + 'application': True +} \ No newline at end of file diff --git a/estate/models/__init__.py b/estate/models/__init__.py new file mode 100644 index 00000000000..f4c8fd6db6d --- /dev/null +++ b/estate/models/__init__.py @@ -0,0 +1 @@ +from . import estate_property \ No newline at end of file diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py new file mode 100644 index 00000000000..86e579fa3e8 --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,24 @@ +from odoo import models,fields + +class EstateProperty(models.Model): + _name = 'estate.property' + _description = 'Real Estate Property' + + name = fields.Char(String="Name",required=True) + description = fields.Text(String="Description") + postcode = fields.Char(String="Postcode") + date_availability = fields.Date(String="Date") + expected_price = fields.Float(String="Expected Price",required=True) + selling_price = fields.Float(String="Selling Price") + bedrooms = fields.Integer(String="Bedrooms") + living_area = fields.Integer(String="Living Area") + facades = fields.Integer(String="Facades") + garage = fields.Boolean(String="Garage") + garden = fields.Boolean(String="Garden") + garden_area = fields.Integer(String="Garden Area") + garden_orientation = fields.Selection([ + ('north','North'), + ('east','East'), + ('west','West'), + ('south','South') + ]) \ No newline at end of file From bcb5cb6d837a7e19cfd0e7b4ad151fbafc0287cd Mon Sep 17 00:00:00 2001 From: habar Date: Wed, 11 Mar 2026 10:42:18 +0530 Subject: [PATCH 2/9] [FIX] estate : improve manifest and EstateProperty model 1) Add missing white spaces after ','. 2) Update parameter String to string. 3) Update manifest file. --- estate/__init__.py | 2 +- estate/__manifest__.py | 5 +++-- estate/models/__init__.py | 2 +- estate/models/estate_property.py | 34 ++++++++++++++------------------ 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/estate/__init__.py b/estate/__init__.py index 9a7e03eded3..0650744f6bc 100644 --- a/estate/__init__.py +++ b/estate/__init__.py @@ -1 +1 @@ -from . import models \ No newline at end of file +from . import models diff --git a/estate/__manifest__.py b/estate/__manifest__.py index f29ccaf8e52..9c14ad3b6fc 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -7,5 +7,6 @@ 'description': """ This is the sample module for practise """, - 'application': True -} \ No newline at end of file + 'application': True, + 'license': 'LGPL-3', +} diff --git a/estate/models/__init__.py b/estate/models/__init__.py index f4c8fd6db6d..5e1963c9d2f 100644 --- a/estate/models/__init__.py +++ b/estate/models/__init__.py @@ -1 +1 @@ -from . import estate_property \ No newline at end of file +from . import estate_property diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 86e579fa3e8..6f1e77bfd26 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -1,24 +1,20 @@ -from odoo import models,fields +from odoo import models, fields class EstateProperty(models.Model): _name = 'estate.property' _description = 'Real Estate Property' - name = fields.Char(String="Name",required=True) - description = fields.Text(String="Description") - postcode = fields.Char(String="Postcode") - date_availability = fields.Date(String="Date") - expected_price = fields.Float(String="Expected Price",required=True) - selling_price = fields.Float(String="Selling Price") - bedrooms = fields.Integer(String="Bedrooms") - living_area = fields.Integer(String="Living Area") - facades = fields.Integer(String="Facades") - garage = fields.Boolean(String="Garage") - garden = fields.Boolean(String="Garden") - garden_area = fields.Integer(String="Garden Area") - garden_orientation = fields.Selection([ - ('north','North'), - ('east','East'), - ('west','West'), - ('south','South') - ]) \ No newline at end of file + name = fields.Char(string="Name", required=True) + description = fields.Text(string="Description") + postcode = fields.Char(string="Postcode") + date_availability = fields.Date(string="Date") + expected_price = fields.Float(string="Expected Price", required=True) + selling_price = fields.Float(string="Selling Price") + bedrooms = fields.Integer(string="Bedrooms") + living_area = fields.Integer(string="Living Area") + facades = fields.Integer(string="Facades") + garage = fields.Boolean(string="Garage") + garden = fields.Boolean(string="Garden") + garden_area = fields.Integer(string="Garden Area") + garden_orientation = fields.Selection([('north','North'), ('east','East'), ('west','West'), ('south','South')]) + \ No newline at end of file From 4d1520c1ba10b7b710260d2c245a8f301405fc61 Mon Sep 17 00:00:00 2001 From: habar Date: Wed, 11 Mar 2026 10:50:23 +0530 Subject: [PATCH 3/9] [FIX] estate : EstateProperty model 1) Add missing white spaces after ','. --- estate/models/estate_property.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 6f1e77bfd26..e408a012f7d 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -16,5 +16,5 @@ class EstateProperty(models.Model): garage = fields.Boolean(string="Garage") garden = fields.Boolean(string="Garden") garden_area = fields.Integer(string="Garden Area") - garden_orientation = fields.Selection([('north','North'), ('east','East'), ('west','West'), ('south','South')]) + garden_orientation = fields.Selection([('north', 'North'), ('east', 'East'), ('west', 'West'), ('south', 'South')]) \ No newline at end of file From bc2d08178dd9961029f7cafadf1a4af053607ca4 Mon Sep 17 00:00:00 2001 From: habar Date: Wed, 11 Mar 2026 11:05:32 +0530 Subject: [PATCH 4/9] [FIX] estate : Update EstateProperty model 1) Add 2 blank lines before starting of the class --- estate/models/estate_property.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index e408a012f7d..e3bc8537443 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -1,9 +1,11 @@ from odoo import models, fields + class EstateProperty(models.Model): _name = 'estate.property' _description = 'Real Estate Property' + name = fields.Char(string="Name", required=True) description = fields.Text(string="Description") postcode = fields.Char(string="Postcode") From dede42999ae5c311f8651ad03b38a3fe5290072c Mon Sep 17 00:00:00 2001 From: habar Date: Wed, 11 Mar 2026 11:28:24 +0530 Subject: [PATCH 5/9] [FIX] estate : Update EstateProperty model 1) Remove 1 blank lines between fields --- estate/models/estate_property.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index e3bc8537443..268ee66e8e0 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -4,8 +4,7 @@ class EstateProperty(models.Model): _name = 'estate.property' _description = 'Real Estate Property' - - + name = fields.Char(string="Name", required=True) description = fields.Text(string="Description") postcode = fields.Char(string="Postcode") @@ -18,5 +17,9 @@ class EstateProperty(models.Model): garage = fields.Boolean(string="Garage") garden = fields.Boolean(string="Garden") garden_area = fields.Integer(string="Garden Area") - garden_orientation = fields.Selection([('north', 'North'), ('east', 'East'), ('west', 'West'), ('south', 'South')]) - \ No newline at end of file + garden_orientation = fields.Selection([ + ('north', 'North'), + ('east', 'East'), + ('west', 'West'), + ('south', 'South') + ]) From e3571041c0b715aed8f09a25378ee6003bb8e58f Mon Sep 17 00:00:00 2001 From: habar Date: Wed, 11 Mar 2026 18:32:14 +0530 Subject: [PATCH 6/9] [ADD] estate: implement security file define access rights 1) Add security file give access rules 2) Update manifest --- estate/__manifest__.py | 10 +++++++--- estate/security/ir.model.access.csv | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 estate/security/ir.model.access.csv diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 9c14ad3b6fc..6dac6179e27 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -2,11 +2,15 @@ 'name': "estate", 'version': '1.0', 'depends': ['base'], - 'author': "Harshvardhan", - 'category': 'Category', + 'author': "habar", + 'category': 'Tutorials', 'description': """ - This is the sample module for practise + This is the sample module for practise. """, + 'data': [ + 'security/ir.model.access.csv' + ], 'application': True, 'license': 'LGPL-3', + 'installable': True, } diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..0e11f47e58d --- /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 +access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 \ No newline at end of file From 2f36915afe5edd121ff03ceef20ffb4042dce98a Mon Sep 17 00:00:00 2001 From: habar Date: Wed, 11 Mar 2026 18:57:44 +0530 Subject: [PATCH 7/9] [ADD] estate: implement security file define access rights 1) remove trailing space --- estate/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 6dac6179e27..05273d27a5d 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -8,7 +8,7 @@ This is the sample module for practise. """, 'data': [ - 'security/ir.model.access.csv' + 'security/ir.model.access.csv', ], 'application': True, 'license': 'LGPL-3', From 2bf9bc4d6a779a7401b9aa8f81d9616178858411 Mon Sep 17 00:00:00 2001 From: habar Date: Thu, 12 Mar 2026 18:46:41 +0530 Subject: [PATCH 8/9] [ADD] estate: Cover chapter 5 ( actions & menus) for estate model Create views folder and define actions & menus for the model Declare it in the manifest --- estate/__manifest__.py | 4 +++- estate/views/estate_menus.xml | 8 ++++++++ estate/views/estate_property_views.xml | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 estate/views/estate_menus.xml create mode 100644 estate/views/estate_property_views.xml diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 05273d27a5d..59f3f604002 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -1,5 +1,5 @@ { - 'name': "estate", + 'name': "Estate", 'version': '1.0', 'depends': ['base'], 'author': "habar", @@ -9,6 +9,8 @@ """, 'data': [ 'security/ir.model.access.csv', + 'views/estate_property_views.xml', + 'views/estate_menus.xml', ], 'application': True, 'license': 'LGPL-3', diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml new file mode 100644 index 00000000000..99abf1350f5 --- /dev/null +++ b/estate/views/estate_menus.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml new file mode 100644 index 00000000000..1d2a3aaa4cd --- /dev/null +++ b/estate/views/estate_property_views.xml @@ -0,0 +1,8 @@ + + + + Properties + estate.property + list,form + + From dc3bc263e01eab0fa8a857ab8654deaa9977b826 Mon Sep 17 00:00:00 2001 From: habar Date: Fri, 13 Mar 2026 19:03:43 +0530 Subject: [PATCH 9/9] [ADD] estate: Define fields attributes & create list view. 1) Define fields & attributes in the model fields. 2) Create list view. --- estate/models/estate_property.py | 21 +++++++++++++++------ estate/views/estate_property_views.xml | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 268ee66e8e0..b4b946f4a3a 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -1,25 +1,34 @@ from odoo import models, fields +from dateutil.relativedelta import relativedelta class EstateProperty(models.Model): _name = 'estate.property' _description = 'Real Estate Property' - name = fields.Char(string="Name", required=True) + name = fields.Char(string="Title", required=True) description = fields.Text(string="Description") postcode = fields.Char(string="Postcode") - date_availability = fields.Date(string="Date") + date_availability = fields.Date(string="Available From", copy=False, default=fields.Date.today()+relativedelta(months=+3)) expected_price = fields.Float(string="Expected Price", required=True) - selling_price = fields.Float(string="Selling Price") - bedrooms = fields.Integer(string="Bedrooms") - living_area = fields.Integer(string="Living Area") + 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 (spm)") facades = fields.Integer(string="Facades") garage = fields.Boolean(string="Garage") garden = fields.Boolean(string="Garden") - garden_area = fields.Integer(string="Garden Area") + garden_area = fields.Integer(string="Garden Area (spm)") garden_orientation = fields.Selection([ ('north', 'North'), ('east', 'East'), ('west', 'West'), ('south', 'South') ]) + active = fields.Boolean(string="Active", default=True) + state = fields.Selection([ + ('new', 'New'), + ('offerreceived', 'Offer Received'), + ('offeraccepted', 'Offer Accepted'), + ('sold', 'Sold'), + ('cancelled', 'Cancelled') + ], string="State", copy=False, default='new') diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml index 1d2a3aaa4cd..35db6dafd91 100644 --- a/estate/views/estate_property_views.xml +++ b/estate/views/estate_property_views.xml @@ -1,5 +1,21 @@ + + estate.property.list + estate.property + + + + + + + + + + + + + Properties estate.property