Skip to content

Commit 4ca27aa

Browse files
committed
[ADD] chapter3-models and basic fields: added EstateProperty model with all required fields
1 parent 0b6bed9 commit 4ca27aa

File tree

3 files changed

+31
-0
lines changed

3 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/models/__int__.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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from odoo import models, fields
2+
3+
4+
class EstateProperty(models.Model):
5+
_name = "estate.property"
6+
_description = "Real Estate Property"
7+
8+
name = fields.Char(string="Property Title", required=True)
9+
description = fields.Text(string="Description")
10+
postcode = fields.Char(string="Postcode")
11+
date_availability = fields.Date(string="Available From")
12+
expected_price = fields.Float(string="Expected Price", required=True)
13+
selling_price = fields.Float(string="Selling Price")
14+
15+
bedrooms = fields.Integer(string="Bedrooms")
16+
living_area = fields.Integer(string="Living Area (sqm)")
17+
facades = fields.Integer(string="Number of Facades")
18+
garage = fields.Boolean(string="Has Garage")
19+
garden = fields.Boolean(string="Has Garden")
20+
garden_area = fields.Integer(string="Garden Area (sqm)")
21+
garden_orientation = fields.Selection(
22+
selection=[
23+
('north', 'North'),
24+
('south', 'South'),
25+
('east', 'East'),
26+
('west', 'West'),
27+
],
28+
string="Garden Orientation"
29+
)

0 commit comments

Comments
 (0)