From e01814d750b564383ee5a7c941e377de6529188b Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Fri, 8 May 2026 15:14:04 +0530 Subject: [PATCH 1/3] [ADD] estate: add empty module shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create the initial Odoo tutorial addon structure so the module is recognized in Apps and can be installed as an empty shell. This PR only adds the minimal required files (__manifest__.py and __init__.py) and does not introduce any models/views yet, following the Odoo “Chapter 2: A New Application” tutorial step. --- estate/__init__.py | 0 estate/__manifest__.py | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 estate/__init__.py create mode 100644 estate/__manifest__.py 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..9b79f977d17 --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,10 @@ +{ + 'name': 'Estate', + 'version': '0.1', + 'category': 'Tutorials', + 'summary': 'Real Estate Advertisement tutorial module (empty shell)', + 'depends': ['base'], + 'data': [], + 'application': True, + 'installable': True, +} From dd04a15adb2a5d8675e56ec3b00e281d8c18a6e6 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Wed, 13 May 2026 17:52:12 +0530 Subject: [PATCH 2/3] [ADD] estate: add author and license information to module manifest --- estate/__manifest__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 9b79f977d17..d7858141d24 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -3,6 +3,8 @@ 'version': '0.1', 'category': 'Tutorials', 'summary': 'Real Estate Advertisement tutorial module (empty shell)', + 'author': 'Patja', + 'license': 'LGPL-3', 'depends': ['base'], 'data': [], 'application': True, From 81f84a05071079169f1e782e2a22b9d37af5c192 Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Fri, 15 May 2026 19:44:39 +0530 Subject: [PATCH 3/3] [REF] awesome_estate: renamed module and added initial model renamed 'estate' to 'awesome_estate' module and added initial property model for estate models and further implementations. And renamed to 'awesome_estate' 'cause why not, awesome anyways sounds better!!! --- awesome_estate/__init__.py | 1 + {estate => awesome_estate}/__manifest__.py | 2 +- awesome_estate/docs/chapter_2.md | 20 +++++++++ awesome_estate/docs/chapter_3.md | 41 +++++++++++++++++ awesome_estate/docs/initial.md | 44 +++++++++++++++++++ awesome_estate/models/__init__.py | 1 + .../models/awesome_estate_property.py | 31 +++++++++++++ estate/__init__.py | 0 8 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 awesome_estate/__init__.py rename {estate => awesome_estate}/__manifest__.py (89%) create mode 100644 awesome_estate/docs/chapter_2.md create mode 100644 awesome_estate/docs/chapter_3.md create mode 100644 awesome_estate/docs/initial.md create mode 100644 awesome_estate/models/__init__.py create mode 100644 awesome_estate/models/awesome_estate_property.py delete mode 100644 estate/__init__.py diff --git a/awesome_estate/__init__.py b/awesome_estate/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/awesome_estate/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/estate/__manifest__.py b/awesome_estate/__manifest__.py similarity index 89% rename from estate/__manifest__.py rename to awesome_estate/__manifest__.py index d7858141d24..a0d14d9f22b 100644 --- a/estate/__manifest__.py +++ b/awesome_estate/__manifest__.py @@ -1,5 +1,5 @@ { - 'name': 'Estate', + 'name': 'Awesome Estate', 'version': '0.1', 'category': 'Tutorials', 'summary': 'Real Estate Advertisement tutorial module (empty shell)', diff --git a/awesome_estate/docs/chapter_2.md b/awesome_estate/docs/chapter_2.md new file mode 100644 index 00000000000..9f455848570 --- /dev/null +++ b/awesome_estate/docs/chapter_2.md @@ -0,0 +1,20 @@ + +Chapter 2: + +["base"] + +- my module needs Odoo core to be installed first + +Where base is in this repo: + +community/odoo/addons/base/ + +What base provides (high level): +- it loads fundamental UI framework pieces, and security bootstrap +- it sets up core records like languages, users, partners, currencies, companies, countries +- it also provides base security/group/access basics(Chapter 4) + +Why my module depends on it: +- without base, Odoo is missing required core models/config/security, so my module can’t install safely + +application:true suggests that is an installable app and false means its a module. diff --git a/awesome_estate/docs/chapter_3.md b/awesome_estate/docs/chapter_3.md new file mode 100644 index 00000000000..e74fbda332a --- /dev/null +++ b/awesome_estate/docs/chapter_3.md @@ -0,0 +1,41 @@ +# How are fields converted to DB? + +- `fields.Char` → varchar (if size set) or text +- `fields.Text` → text +- `fields.Integer` → int4 (PostgreSQL integer) +- `fields.Float` → numeric (with precision) or float8 (if no digits) +- `fields.Boolean` → bool +- `fields.Date` → date +- `fields.Datetime` → timestamp (without timezone — UTC) +- `fields.Selection` → varchar (stores the internal key string) +- `fields.Many2one` → int4 (foreign key) +- `fields.Binary` → bytea (if not attachment) or stored in `ir.attachment` +- `fields.Html` → text +- `fields.Monetary` → numeric (linked to a currency) + +--- + +## Blueprint / methods / required + +- `class` = blueprint +- `methods` = functions +- `required=True` translates to `NOT NULL` in SQL + +--- + +## Module namespace vs business concept + +- `awesome_estate` is the `__module__` namespace (a conventional prefix) +- `property` is the business concept inside that module + +So the technical model name becomes: `awesome_estate.property` + +--- + +## Selection: key vs label + +- __key__ / internal value (stored in DB) + - `"north"`, `"south"`, `"east"`, `"west"` + +- __label__ / display value (shown in UI) + - `"North"`, `"South"`, `"East"`, `"West"` diff --git a/awesome_estate/docs/initial.md b/awesome_estate/docs/initial.md new file mode 100644 index 00000000000..41052aad40d --- /dev/null +++ b/awesome_estate/docs/initial.md @@ -0,0 +1,44 @@ +# Notes + + +## Start odoo command: + +`./odoo-bin -d --addons-path=` + +### Breakdown: + +`./odoo-bin` : starts the Odoo server +`-d ` : which PostgreSQL database to use (for me: patja) +`--addons-path=` : comma-separated addon folders that Odoo will scan + +### it does: +- loads already-installed modules +- starts the UI and backend services + + +## Upgrade a module (Chapter - 3) + +### Command: + +`./odoo-bin -d -u --addons-path=` + +### Meaning: +`- -u ` : reload it and apply its model/data changes + +### it does: + +- after changing Python models (ORM), upgrade so database schema updates happen` +- after adding security/ACL, upgrade so access rules apply` + +### for me: + +`./odoo-bin --addons-path=addons,../enterprise/,../tutorials/ -d patja -u awesome_estate` + + +## Install a module (first time) + +### Command: +`./odoo-bin -d -i --addons-path=` + +### Meaning: +`- -i `: install the module for the first time in that database diff --git a/awesome_estate/models/__init__.py b/awesome_estate/models/__init__.py new file mode 100644 index 00000000000..2419350f1e9 --- /dev/null +++ b/awesome_estate/models/__init__.py @@ -0,0 +1 @@ +from . import awesome_estate_property diff --git a/awesome_estate/models/awesome_estate_property.py b/awesome_estate/models/awesome_estate_property.py new file mode 100644 index 00000000000..4f6822396b2 --- /dev/null +++ b/awesome_estate/models/awesome_estate_property.py @@ -0,0 +1,31 @@ +from odoo import fields, models + + +class AwesomeEstateProperty(models.Model): + _name = "awesome_estate.property" + _description = "Real Estate Property" + + 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"), + ] + ) diff --git a/estate/__init__.py b/estate/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000