From 55b2599150768c22ab62ca09ecea5c937026139a Mon Sep 17 00:00:00 2001 From: mawat-odoo Date: Tue, 15 Sep 2026 13:22:31 +0200 Subject: [PATCH 1/5] [ADD] estate: create initial module structure and manifest Initialize the estate module with its basic directory structure and manifest file as required for the technical onboarding training. task-6573564 --- .gitignore | 55 +++++++++++++++++++++++++++++++++++++++--- estate/__init__.py | 0 estate/__manifest__.py | 8 ++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 estate/__init__.py create mode 100644 estate/__manifest__.py diff --git a/.gitignore b/.gitignore index b6e47617de1..1461e9611c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ +# Created by https://www.toptal.com/developers/gitignore/api/python,odoo +# Edit at https://www.toptal.com/developers/gitignore?templates=python,odoo + +#!! ERROR: odoo is undefined. Use list command to see defined gitignore types !!# + +### Python ### # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -20,7 +26,6 @@ parts/ sdist/ var/ wheels/ -pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg @@ -50,6 +55,7 @@ coverage.xml *.py,cover .hypothesis/ .pytest_cache/ +cover/ # Translations *.mo @@ -72,6 +78,7 @@ instance/ docs/_build/ # PyBuilder +.pybuilder/ target/ # Jupyter Notebook @@ -82,7 +89,9 @@ profile_default/ ipython_config.py # pyenv -.python-version +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. @@ -91,7 +100,22 @@ ipython_config.py # install all needed dependencies. #Pipfile.lock -# PEP 582; used by e.g. github.com/David-OConnor/pyflow +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm __pypackages__/ # Celery stuff @@ -127,3 +151,28 @@ dmypy.json # Pyre type checker .pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +# End of https://www.toptal.com/developers/gitignore/api/python,odoo diff --git a/estate/__init__.py b/estate/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/estate/__manifest__.py b/estate/__manifest__.py new file mode 100644 index 00000000000..fc47b3ba410 --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,8 @@ +# __manifest__.py +{ # noqa: B018 + "author": "mawat", + "name": "estate", + "depends": ["base"], + "application": True, + "license": "LGPL-3", +} From 3e53ed6cd708ebf82a0c38357a95328b5d4f4fa2 Mon Sep 17 00:00:00 2001 From: mawat-odoo Date: Wed, 16 Sep 2026 09:22:49 +0200 Subject: [PATCH 2/5] [ADD] estate: create estate.property model with basic fields - Create models package and __init__.py files - Define estate.property model with basic fields: * name, description, postcode * date_availability, expected_price, selling_price * bedrooms, living_area, facades, garage * garden, garden_area, garden_orientation task-6573564 --- estate/__init__.py | 1 + estate/models/__init__.py | 1 + estate/models/estate_property.py | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) 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 index e69de29bb2d..0650744f6bc 100644 --- a/estate/__init__.py +++ b/estate/__init__.py @@ -0,0 +1 @@ +from . import models 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..7deaa93f21e --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,23 @@ +from odoo import fields, models + + +class EstateProperty(models.Model): + _name = "estate.property" + _description = "Estate property model" + + name = fields.Char(required=True) + description = fields.Text() + postcode = fields.Char() + date_availibility = 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( + string='Type', + selection=[('North', 'North'), ('South', 'South'), ('East', 'East'), ('West', 'West')] + ) From 8e7aed27792402db595a6264526e853278d8085a Mon Sep 17 00:00:00 2001 From: mawat-odoo Date: Wed, 16 Sep 2026 09:56:39 +0200 Subject: [PATCH 3/5] [FIX] remove environmental gitignore file --- .gitignore | 178 ----------------------------------------------------- 1 file changed, 178 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1461e9611c2..00000000000 --- a/.gitignore +++ /dev/null @@ -1,178 +0,0 @@ -# Created by https://www.toptal.com/developers/gitignore/api/python,odoo -# Edit at https://www.toptal.com/developers/gitignore?templates=python,odoo - -#!! ERROR: odoo is undefined. Use list command to see defined gitignore types !!# - -### Python ### -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ - -### Python Patch ### -# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration -poetry.toml - -# ruff -.ruff_cache/ - -# LSP config files -pyrightconfig.json - -# End of https://www.toptal.com/developers/gitignore/api/python,odoo From 9f2dbc6959008e4fb008a14603e5e5bd99b6cd86 Mon Sep 17 00:00:00 2001 From: mawat-odoo Date: Wed, 16 Sep 2026 11:01:53 +0200 Subject: [PATCH 4/5] [ADD] estate: add access rights for estate.property model - Add security/ir.model.access.csv with full permissions for internal users - Declare security file in __manifest__.py task-6573564 --- estate/__manifest__.py | 3 +++ estate/security/ir.model.access.csv | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 estate/security/ir.model.access.csv diff --git a/estate/__manifest__.py b/estate/__manifest__.py index fc47b3ba410..ec3e036aa21 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -5,4 +5,7 @@ "depends": ["base"], "application": True, "license": "LGPL-3", + "data": [ + "security/ir.model.access.csv", + ], } diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..ed7060e60a7 --- /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,estate_property,model_estate_property,base.group_user,1,1,1,1 From 32a2e2520ac7933ffe397f9eb233c706a2dfae18 Mon Sep 17 00:00:00 2001 From: mawat-odoo Date: Thu, 17 Sep 2026 00:40:56 +0200 Subject: [PATCH 5/5] [ADD] estate: add UI action, menus, field attributes, and reserved fields - Create estate_property_views.xml with act_window for estate.property model - Create estate_menus.xml with 3-level menu hierarchy - Register XML files sequentially in __manifest__.py - Set selling_price as readonly and non-copyable - Prevent copy on date_availability and set default to 3 months from today - Set default bedrooms to 2 - Add reserved active field (Boolean) with default=True - Add required state field (Selection: New, Offer Received, Offer Accepted, Sold, Cancelled) with default='new' and copy=False task-6573564 --- estate/__manifest__.py | 2 ++ estate/models/estate_property.py | 17 ++++++++++++++--- estate/views/estate_menus.xml | 8 ++++++++ estate/views/estate_property_views.xml | 8 ++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) 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 ec3e036aa21..05e007850c5 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -7,5 +7,7 @@ "license": "LGPL-3", "data": [ "security/ir.model.access.csv", + "views/estate_property_views.xml", + "views/estate_menus.xml" ], } diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 7deaa93f21e..136a0598222 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -1,3 +1,5 @@ +from odoo.tools import date_utils + from odoo import fields, models @@ -5,13 +7,22 @@ class EstateProperty(models.Model): _name = "estate.property" _description = "Estate property model" + active = fields.Boolean('Active', default=True) + state = fields.Selection([ + ('new', 'New'), + ('offer received', 'Offer Received'), + ('offer accepted', 'Offer Accepted'), + ('sold', 'Sold'), + ('cancelled', 'Cancelled') + ], string='Status', default='new', required=True, copy=False) + name = fields.Char(required=True) description = fields.Text() postcode = fields.Char() - date_availibility = fields.Date() + date_availibility = fields.Date(copy=False, default=lambda self: date_utils.add(fields.Date.today(), months=3)) expected_price = fields.Float(required=True) - selling_price = fields.Float() - bedrooms = fields.Integer() + selling_price = fields.Float(readonly=True, copy=False) + bedrooms = fields.Integer(default=2) living_area = fields.Integer() facades = fields.Integer() garage = fields.Boolean() diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml new file mode 100644 index 00000000000..f12c6192cf8 --- /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 + +