From fcf8c80fda7bac405b8317161ca3170ef8ac3821 Mon Sep 17 00:00:00 2001 From: lokesh Date: Mon, 3 Aug 2026 19:03:49 +0530 Subject: [PATCH 1/7] [ADD] real_estate:created new module --- estate/__init__.py | 1 + estate/__manifest__.py | 7 +++++++ estate/models/__init__.py | 1 + estate/models/estate_property.py | 6 ++++++ 4 files changed, 15 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..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..81356cc39ca --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,7 @@ +{ + 'name': 'real estate', + 'depends': [ + 'base' + ], + 'application': True, +} 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..8b030df4ccc --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,6 @@ +from odoo import models + + +class TestModel(models.Model): + _name = "estate.property" + _description = "This is a dummy table" From e63894215c960358748633f64f22d9ef79daa7b3 Mon Sep 17 00:00:00 2001 From: lokesh Date: Tue, 4 Aug 2026 15:07:22 +0530 Subject: [PATCH 2/7] [IMP] estate: added the security csv file [IMP] estate: added spcaes after comma in estate_property.py file --- estate/__manifest__.py | 6 ++++++ estate/models/estate_property.py | 23 ++++++++++++++++++++++- estate/security/ir.model.access.csv | 2 ++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 estate/security/ir.model.access.csv diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 81356cc39ca..332fff9b1cb 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -1,7 +1,13 @@ { 'name': 'real estate', + 'author': 'Lokesh', + 'version': '1.0.0', + 'license': 'LGPL-3', 'depends': [ 'base' ], 'application': True, + 'data': [ + 'security/ir.model.access.csv', + ], } diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 8b030df4ccc..764afe7c605 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -1,6 +1,27 @@ -from odoo import models +from odoo import models, fields class TestModel(models.Model): _name = "estate.property" _description = "This is a dummy table" + + name = fields.Char(required=True) + description = fields.Text() + postcode = fields.Char() + date_availability = 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([ + ('north', 'North'), + ('south', 'South'), + ('east', 'East'), + ('west', 'West'), + ], + string="Direction", + default='north') diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..c4f7ae7bd45 --- /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_user,estate.property.user,model_estate_property,base.group_user,1,1,1,1 \ No newline at end of file From 16d935bba5f86c922115f312a5380fae22d1befa Mon Sep 17 00:00:00 2001 From: lokesh Date: Wed, 5 Aug 2026 18:49:43 +0530 Subject: [PATCH 3/7] [IMP] estate: added security and view files --- awesome_dashboard/__manifest__.py | 2 +- estate/__manifest__.py | 1 + estate/security/ir.model.access.csv | 2 +- estate/views/estate_property_views.xml | 11 +++++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 estate/views/estate_property_views.xml diff --git a/awesome_dashboard/__manifest__.py b/awesome_dashboard/__manifest__.py index a1cd72893d7..c24c020c649 100644 --- a/awesome_dashboard/__manifest__.py +++ b/awesome_dashboard/__manifest__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- { - 'name': "Awesome Dashboard", + 'name': "Awesome Dashboard1", 'summary': """ Starting module for "Discover the JS framework, chapter 2: Build a dashboard" diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 332fff9b1cb..c399b53dec2 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -9,5 +9,6 @@ 'application': True, 'data': [ 'security/ir.model.access.csv', + 'views/estate_property_views.xml' ], } diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv index c4f7ae7bd45..9dc9388f45a 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 -access_estate_property_user,estate.property.user,model_estate_property,base.group_user,1,1,1,1 \ No newline at end of file +access_estate_property_user,estate.property.user,model_estate_property,base.group_user,1,1,1,1 diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml new file mode 100644 index 00000000000..4a6785e36ac --- /dev/null +++ b/estate/views/estate_property_views.xml @@ -0,0 +1,11 @@ + + + + Proprety + estate.property + list,form + + + + + From e640341721d49131f3e260ba38ab35e07c9f096f Mon Sep 17 00:00:00 2001 From: lokesh Date: Thu, 6 Aug 2026 12:27:10 +0530 Subject: [PATCH 4/7] [IMP] estate: added views and menu items [IMP] estate: added a modal and fixed the working --- estate/__manifest__.py | 22 ++--- estate/models/estate_property.py | 31 +++++-- estate/views/estate_property_actions.xml | 24 +++++ estate/views/estate_property_menu.xml | 33 +++++++ estate/views/estate_property_views.xml | 109 +++++++++++++++++++++-- 5 files changed, 191 insertions(+), 28 deletions(-) create mode 100644 estate/views/estate_property_actions.xml create mode 100644 estate/views/estate_property_menu.xml diff --git a/estate/__manifest__.py b/estate/__manifest__.py index c399b53dec2..13a83ca449f 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -1,14 +1,14 @@ { - 'name': 'real estate', - 'author': 'Lokesh', - 'version': '1.0.0', - 'license': 'LGPL-3', - 'depends': [ - 'base' - ], - 'application': True, - 'data': [ - 'security/ir.model.access.csv', - 'views/estate_property_views.xml' + "name": "real estate", + "author": "Lokesh", + "version": "1.0.0", + "license": "LGPL-3", + "depends": ["base"], + "application": True, + "data": [ + "security/ir.model.access.csv", + "views/estate_property_actions.xml", # the order should be like this, first we need to define the action and then we need to define the menu and then the views if the order is not maintained then error will be thrown. + "views/estate_property_views.xml", + "views/estate_property_menu.xml", ], } diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 764afe7c605..58f57a3a166 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -1,4 +1,4 @@ -from odoo import models, fields +from odoo import fields, models class TestModel(models.Model): @@ -17,11 +17,24 @@ class TestModel(models.Model): garage = fields.Boolean() garden = fields.Boolean() garden_area = fields.Integer() - garden_orientation = fields.Selection([ - ('north', 'North'), - ('south', 'South'), - ('east', 'East'), - ('west', 'West'), - ], - string="Direction", - default='north') + garden_orientation = fields.Selection( + [ + ("north", "North"), + ("south", "South"), + ("east", "East"), + ("west", "West"), + ], + string="Direction", + default="north", + ) + active = fields.Boolean("active", default=True) + + def action_confirm(self): + print("button is clicked") + return { + "type": "ir.actions.act_window", + "name": "Properties", + "res_model": "estate.property", + "view_mode": "form", + "target": "current", + } diff --git a/estate/views/estate_property_actions.xml b/estate/views/estate_property_actions.xml new file mode 100644 index 00000000000..845a93f4029 --- /dev/null +++ b/estate/views/estate_property_actions.xml @@ -0,0 +1,24 @@ + + + + Property + estate.property + list,form + + + + + + Properties2 + estate.property + + + form + new + + diff --git a/estate/views/estate_property_menu.xml b/estate/views/estate_property_menu.xml new file mode 100644 index 00000000000..eb12d1b27f6 --- /dev/null +++ b/estate/views/estate_property_menu.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml index 4a6785e36ac..055131c6497 100644 --- a/estate/views/estate_property_views.xml +++ b/estate/views/estate_property_views.xml @@ -1,11 +1,104 @@ - - Proprety - estate.property - list,form - - - - + + + estate.property.form + estate.property + +
+ + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + estate property wizard + estate.property + +
+ + + + + + +
+
+
+
+
+ + + + estate property views + estate.property + + + + + + + + + +
From 8070edb54b2ffce3342de25349b24e4b805bc2fe Mon Sep 17 00:00:00 2001 From: lokesh Date: Wed, 2 Sep 2026 11:23:27 +0530 Subject: [PATCH 5/7] [IMP] estate: added estate_property_type table and connected the two table (estate_property and estate_property_type) using Many2one --- estate/__manifest__.py | 11 ++++- estate/models/__init__.py | 2 +- estate/models/estate_property.py | 26 +++++++--- estate/models/estate_property_type.py | 8 +++ estate/security/ir.model.access.csv | 4 +- estate/security/securities.xml | 5 ++ estate/static/src/estate.css | 0 estate/views/estate_property_actions.xml | 16 +----- estate/views/estate_property_menu.xml | 8 +-- estate/views/estate_property_type_view.xml | 14 ++++++ estate/views/estate_property_views.xml | 57 +++++++--------------- 11 files changed, 83 insertions(+), 68 deletions(-) create mode 100644 estate/models/estate_property_type.py create mode 100644 estate/security/securities.xml create mode 100644 estate/static/src/estate.css create mode 100644 estate/views/estate_property_type_view.xml diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 13a83ca449f..bb035f8b4ca 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -3,12 +3,19 @@ "author": "Lokesh", "version": "1.0.0", "license": "LGPL-3", - "depends": ["base"], + # "depends": ["base"], "application": True, + "installable": True, "data": [ + "security/securities.xml", "security/ir.model.access.csv", - "views/estate_property_actions.xml", # the order should be like this, first we need to define the action and then we need to define the menu and then the views if the order is not maintained then error will be thrown. "views/estate_property_views.xml", + "views/estate_property_actions.xml", # the order should be like this, first we need to define the views and then we need to define the action and then the menu if the order is not maintained then error will be thrown. "views/estate_property_menu.xml", ], + "assets": { + "web.assets_backend": [ + "estate/static/src/estate.css", + ], + }, } diff --git a/estate/models/__init__.py b/estate/models/__init__.py index 5e1963c9d2f..76e779e73b0 100644 --- a/estate/models/__init__.py +++ b/estate/models/__init__.py @@ -1 +1 @@ -from . import estate_property +from . import estate_property, estate_property_type diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 58f57a3a166..96aab7f23e9 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -1,16 +1,30 @@ +from datetime import datetime + from odoo import fields, models class TestModel(models.Model): + today = datetime.now() + + month = today.month + 3 + year = today.year + day = today.day + + if month > 12: + year = year + 1 + month = month % 12 + + three_month_date = today.replace(year=year, month=month, day=day) + _name = "estate.property" _description = "This is a dummy table" - name = fields.Char(required=True) + name = fields.Char(translate=True, default="Unknown", required=True) description = fields.Text() postcode = fields.Char() - date_availability = fields.Date() + date_availability = fields.Date(copy=False, default=three_month_date.date()) expected_price = fields.Float(required=True) - selling_price = fields.Float() + selling_price = fields.Float(readonly=True, copy=False) bedrooms = fields.Integer() living_area = fields.Integer() facades = fields.Integer() @@ -27,12 +41,12 @@ class TestModel(models.Model): string="Direction", default="north", ) - active = fields.Boolean("active", default=True) + active = fields.Boolean("Active", default=True) + property_type_id = fields.Many2one("estate.property.type", string="Property_type") def action_confirm(self): - print("button is clicked") return { - "type": "ir.actions.act_window", + "type": "ir.actions.act_window", # type and name are very important "name": "Properties", "res_model": "estate.property", "view_mode": "form", diff --git a/estate/models/estate_property_type.py b/estate/models/estate_property_type.py new file mode 100644 index 00000000000..27f87357895 --- /dev/null +++ b/estate/models/estate_property_type.py @@ -0,0 +1,8 @@ +from odoo import fields, models + + +class PropertyType(models.Model): + _name = "estate.property.type" + _description = "this is used to define the types" + + name = fields.Char(required=True) diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv index 9dc9388f45a..267f7ff3075 100644 --- a/estate/security/ir.model.access.csv +++ b/estate/security/ir.model.access.csv @@ -1,2 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_estate_property_user,estate.property.user,model_estate_property,base.group_user,1,1,1,1 +access_estate_property_user1,estate.property.user,model_estate_property,base.group_user,1,0,0,0 +access_estate_property_user,estate.property.user,model_estate_property,base.group_system,1,1,1,1 +access_estate_property_type_user,estate.property.type.user,model_estate_property_type,base.group_system,1,1,1,1 diff --git a/estate/security/securities.xml b/estate/security/securities.xml new file mode 100644 index 00000000000..7f759d69eb6 --- /dev/null +++ b/estate/security/securities.xml @@ -0,0 +1,5 @@ + + + Estate Administrator + + diff --git a/estate/static/src/estate.css b/estate/static/src/estate.css new file mode 100644 index 00000000000..e69de29bb2d diff --git a/estate/views/estate_property_actions.xml b/estate/views/estate_property_actions.xml index 845a93f4029..e27b62eca71 100644 --- a/estate/views/estate_property_actions.xml +++ b/estate/views/estate_property_actions.xml @@ -4,21 +4,7 @@ Property estate.property list,form - + - - - Properties2 - estate.property - - - form - new - diff --git a/estate/views/estate_property_menu.xml b/estate/views/estate_property_menu.xml index eb12d1b27f6..2de513e0a28 100644 --- a/estate/views/estate_property_menu.xml +++ b/estate/views/estate_property_menu.xml @@ -5,10 +5,10 @@ - diff --git a/estate/views/estate_property_type_view.xml b/estate/views/estate_property_type_view.xml new file mode 100644 index 00000000000..493b373d3b8 --- /dev/null +++ b/estate/views/estate_property_type_view.xml @@ -0,0 +1,14 @@ + + + + estate.property.type + +
+ + + +
+
+ +
+
\ No newline at end of file diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml index 055131c6497..861b8a47fd4 100644 --- a/estate/views/estate_property_views.xml +++ b/estate/views/estate_property_views.xml @@ -2,34 +2,26 @@ - estate.property.form + estate.property
- - - - - - +
- - + @@ -39,8 +31,6 @@ - - @@ -50,53 +40,42 @@ - - - - - -
- - estate property wizard + + estate property search view estate.property -
- - - - - - -
-
-
+ + + + +
- estate property views estate.property - - - - + + + + + + + From 0ea4e3a0be508c92a0efe5f8960a91a49fb80dfc Mon Sep 17 00:00:00 2001 From: lokesh Date: Wed, 2 Sep 2026 15:22:46 +0530 Subject: [PATCH 6/7] [IMP] estate: added property_type_id in the view xml --- estate/__manifest__.py | 4 +-- estate/models/estate_property_type.py | 2 +- estate/views/estate_property_actions.xml | 10 -------- estate/views/estate_property_menu.xml | 30 ++++++++-------------- estate/views/estate_property_type_view.xml | 12 ++++++--- estate/views/estate_property_views.xml | 13 +++++----- 6 files changed, 30 insertions(+), 41 deletions(-) delete mode 100644 estate/views/estate_property_actions.xml diff --git a/estate/__manifest__.py b/estate/__manifest__.py index bb035f8b4ca..1b121b141f4 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -9,8 +9,8 @@ "data": [ "security/securities.xml", "security/ir.model.access.csv", - "views/estate_property_views.xml", - "views/estate_property_actions.xml", # the order should be like this, first we need to define the views and then we need to define the action and then the menu if the order is not maintained then error will be thrown. + "views/estate_property_views.xml", # the order should be like this, first we need to define the views and then we need to define the action and then the menu if the order is not maintained then error will be thrown. + "views/estate_property_type_view.xml", "views/estate_property_menu.xml", ], "assets": { diff --git a/estate/models/estate_property_type.py b/estate/models/estate_property_type.py index 27f87357895..b3b0d0094ee 100644 --- a/estate/models/estate_property_type.py +++ b/estate/models/estate_property_type.py @@ -5,4 +5,4 @@ class PropertyType(models.Model): _name = "estate.property.type" _description = "this is used to define the types" - name = fields.Char(required=True) + name = fields.Char(required=True, string="Type") diff --git a/estate/views/estate_property_actions.xml b/estate/views/estate_property_actions.xml deleted file mode 100644 index e27b62eca71..00000000000 --- a/estate/views/estate_property_actions.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - Property - estate.property - list,form - - - - diff --git a/estate/views/estate_property_menu.xml b/estate/views/estate_property_menu.xml index 2de513e0a28..4d13f8652f2 100644 --- a/estate/views/estate_property_menu.xml +++ b/estate/views/estate_property_menu.xml @@ -1,33 +1,25 @@ - - - - - + + - - - - diff --git a/estate/views/estate_property_type_view.xml b/estate/views/estate_property_type_view.xml index 493b373d3b8..9d168bf7334 100644 --- a/estate/views/estate_property_type_view.xml +++ b/estate/views/estate_property_type_view.xml @@ -1,14 +1,20 @@ - + + estate.property.type
- +
+
+ + Property Type + estate.property.type + list,form -
\ No newline at end of file +
diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml index 861b8a47fd4..c1dac48599d 100644 --- a/estate/views/estate_property_views.xml +++ b/estate/views/estate_property_views.xml @@ -1,14 +1,10 @@ - - estate.property
- -
@@ -33,13 +34,27 @@ - - - - - + + + + + + + + + + + + + + + + + + +
@@ -74,11 +89,11 @@
- + + Property estate.property list,form -