Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions awesome_estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
12 changes: 12 additions & 0 deletions awesome_estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
'name': 'Awesome Estate',
'version': '0.1',
'category': 'Tutorials',
'summary': 'Real Estate Advertisement tutorial module (empty shell)',
'author': 'Patja',
'license': 'LGPL-3',
'depends': ['base'],
'data': [],
'application': True,
'installable': True,
}
20 changes: 20 additions & 0 deletions awesome_estate/docs/chapter_2.md
Original file line number Diff line number Diff line change
@@ -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.
41 changes: 41 additions & 0 deletions awesome_estate/docs/chapter_3.md
Original file line number Diff line number Diff line change
@@ -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"`
44 changes: 44 additions & 0 deletions awesome_estate/docs/initial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Notes


## Start odoo command:

`./odoo-bin -d <db_name> --addons-path=<paths...>`

### Breakdown:

`./odoo-bin` : starts the Odoo server
`-d <db_name>` : which PostgreSQL database to use (for me: patja)
`--addons-path=<paths...>` : 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 <db_name> -u <module_name> --addons-path=<paths...>`

### Meaning:
`- -u <module_name>` : 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 <db_name> -i <module_name> --addons-path=<paths...>`

### Meaning:
`- -i <module_name> `: install the module for the first time in that database
1 change: 1 addition & 0 deletions awesome_estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import awesome_estate_property
31 changes: 31 additions & 0 deletions awesome_estate/models/awesome_estate_property.py
Original file line number Diff line number Diff line change
@@ -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"),
]
)