-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] estate: Chapter 4, add estate_property model
- Loading branch information
1 parent
29d0fd9
commit 9575abd
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from . import estate_property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from odoo import fields, models | ||
|
||
class EstateProperty(models.Model): | ||
_name = "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') | ||
]) | ||
|