Skip to content

Commit 91f35b0

Browse files
committed
[IMP] estate: Chapter 3 - Models and Basic Fields
1 parent 4281085 commit 91f35b0

File tree

5 files changed

+47
-2
lines changed

5 files changed

+47
-2
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
'name': "Estate",
44

55
'summary': """
6-
Starting module for "Discover the JS framework, chapter 1: Owl components"
6+
App module created specifically for the Server Framework 101 tutorial.
77
""",
88

99
'description': """
10-
Starting module for "Discover the JS framework, chapter 1: Owl components"
10+
App module created specifically for the Server Framework 101 tutorial.
1111
""",
1212

1313
'author': "Odoo",

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 EstatePropertyModel(models.Model):
4+
_name = "estate_property"
5+
_description = "Real Estate property database"
6+
7+
name = fields.Char(required=True)
8+
description = fields.Text()
9+
postcode = fields.Char()
10+
date_availability = fields.Date()
11+
expected_price = fields.Float(required=True)
12+
selling_price = fields.Float()
13+
bedrooms = fields.Integer()
14+
living_area = fields.Integer()
15+
facades = fields.Integer()
16+
garage = fields.Boolean()
17+
garden = fields.Boolean()
18+
garden_area = fields.Integer()
19+
garden_orientation = fields.Selection(
20+
selection=[
21+
('north', 'North'),
22+
('east', 'East'),
23+
('south', 'South'),
24+
('west', 'West'),
25+
],
26+
string='Garden Orientation',
27+
default='south',
28+
)

estate/views/templates.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<odoo>
2+
<data>
3+
<template id="estate.example" name="Awesome T-Shirt thank you">
4+
<html>
5+
<head>
6+
<link type="image/x-icon" rel="shortcut icon" href="/web/static/img/favicon.ico"/>
7+
<t t-call-assets="awesome_owl.assets_playground"/>
8+
</head>
9+
10+
<body>
11+
</body>
12+
</html>
13+
</template>
14+
</data>
15+
</odoo>

0 commit comments

Comments
 (0)