Skip to content

Commit 1f92b58

Browse files
author
youness benbraitit (yoben)
committed
[ADD]estate: database field creation
added more fields to the database table with needed requirements
1 parent 48b008c commit 1f92b58

File tree

3 files changed

+36
-0
lines changed

3 files changed

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

0 commit comments

Comments
 (0)