Skip to content

Commit 88181a3

Browse files
committed
[ADD] Chapter 2&3 (Estate)
Completed the initial setup for the new Real Estate module. Created the base directory structure and manifest. Successfully installed the module. Initialized model and model fields which generates tables using odoo ORM
1 parent 781b590 commit 88181a3

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

estate/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models

estate/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{'name': 'Real Estate', 'depends': ['base']}

estate/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import estate_property

estate/models/estate_property.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from odoo import fields, models
2+
3+
class EstateProperty(models.Model):
4+
_name = "estate.property"
5+
_description = "Real Estate Property" # Removes the terminal warning
6+
7+
# Required fields (not null in database)
8+
name = fields.Char(required=True)
9+
expected_price = fields.Float(required=True)
10+
11+
# Basic fields
12+
description = fields.Text()
13+
postcode = fields.Char()
14+
date_availability = fields.Date()
15+
selling_price = fields.Float()
16+
bedrooms = fields.Integer()
17+
living_area = fields.Integer()
18+
facades = fields.Integer()
19+
garage = fields.Boolean()
20+
garden = fields.Boolean()
21+
garden_area = fields.Integer()
22+
23+
# Selection field (Dropdown)
24+
garden_orientation = fields.Selection(
25+
string='Orientation',
26+
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')],
27+
help="The direction the garden faces."
28+
)

0 commit comments

Comments
 (0)