From 7194a8c275544a3e33de3ac63ca314484af388bc Mon Sep 17 00:00:00 2001 From: Alexey Magay Date: Mon, 15 Dec 2025 14:05:39 +0100 Subject: [PATCH 1/3] chapter 2 --- estate/__init__.py | 0 estate/__manifest__.py | 43 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 estate/__init__.py create mode 100644 estate/__manifest__.py diff --git a/estate/__init__.py b/estate/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/estate/__manifest__.py b/estate/__manifest__.py new file mode 100644 index 00000000000..297430d677b --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +{ + 'name': "Estate", + + 'summary': """ + Starting module for "Discover the JS framework, chapter 1: Owl components" + """, + + 'description': """ + Starting module for "Discover the JS framework, chapter 1: Owl components" + """, + + 'author': "Odoo", + 'website': "https://www.odoo.com", + + # Categories can be used to filter modules in modules listing + # Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml + # for the full list + 'category': 'Tutorials', + 'version': '0.1', + + # any module necessary for this one to work correctly + 'depends': ['base', 'web'], + 'application': True, + 'installable': True, + 'data': [ + 'views/templates.xml', + ], + 'assets': { + 'awesome_owl.assets_playground': [ + ('include', 'web._assets_helpers'), + ('include', 'web._assets_backend_helpers'), + 'web/static/src/scss/pre_variables.scss', + 'web/static/lib/bootstrap/scss/_variables.scss', + 'web/static/lib/bootstrap/scss/_maps.scss', + ('include', 'web._assets_bootstrap'), + ('include', 'web._assets_core'), + 'web/static/src/libs/fontawesome/css/font-awesome.css', + 'awesome_owl/static/src/**/*', + ], + }, + 'license': 'AGPL-3' +} From c366b4a86ea3531a855bb03a1b882ff1a3e30f96 Mon Sep 17 00:00:00 2001 From: Alexey Magay Date: Mon, 15 Dec 2025 14:47:02 +0100 Subject: [PATCH 2/3] [ADD] Chapter 3 --- estate/__init__.py | 1 + estate/__manifest__.py | 4 ++-- estate/models/__init__.py | 1 + estate/models/estate_property.py | 28 ++++++++++++++++++++++++++++ estate/views/templates.xml | 15 +++++++++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 estate/models/__init__.py create mode 100644 estate/models/estate_property.py create mode 100644 estate/views/templates.xml diff --git a/estate/__init__.py b/estate/__init__.py index e69de29bb2d..9a7e03eded3 100644 --- a/estate/__init__.py +++ b/estate/__init__.py @@ -0,0 +1 @@ +from . import models \ No newline at end of file diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 297430d677b..d7da6c986fa 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -3,11 +3,11 @@ 'name': "Estate", 'summary': """ - Starting module for "Discover the JS framework, chapter 1: Owl components" + App module created specifically for the Server Framework 101 tutorial. """, 'description': """ - Starting module for "Discover the JS framework, chapter 1: Owl components" + App module created specifically for the Server Framework 101 tutorial. """, 'author': "Odoo", diff --git a/estate/models/__init__.py b/estate/models/__init__.py new file mode 100644 index 00000000000..f4c8fd6db6d --- /dev/null +++ b/estate/models/__init__.py @@ -0,0 +1 @@ +from . import estate_property \ No newline at end of file diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py new file mode 100644 index 00000000000..2ef12abba76 --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,28 @@ +from odoo import fields, models + +class EstatePropertyModel(models.Model): + _name = "estate_property" + _description = "Real Estate property database" + + 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( + selection=[ + ('north', 'North'), + ('east', 'East'), + ('south', 'South'), + ('west', 'West'), + ], + string='Garden Orientation', + default='south', + ) diff --git a/estate/views/templates.xml b/estate/views/templates.xml new file mode 100644 index 00000000000..dca3ce80d27 --- /dev/null +++ b/estate/views/templates.xml @@ -0,0 +1,15 @@ + + + + + From 0357532d7d68c1573edf125a6c715fe97f9b4de6 Mon Sep 17 00:00:00 2001 From: Alexey Magay Date: Mon, 15 Dec 2025 16:18:30 +0100 Subject: [PATCH 3/3] [ADD] Chapter 4 --- estate/__manifest__.py | 27 ++------------------------- estate/data/ir.model.access.csv | 2 ++ estate/models/estate_property.py | 1 - 3 files changed, 4 insertions(+), 26 deletions(-) create mode 100644 estate/data/ir.model.access.csv diff --git a/estate/__manifest__.py b/estate/__manifest__.py index d7da6c986fa..a2c2a95a528 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -1,43 +1,20 @@ -# -*- coding: utf-8 -*- { 'name': "Estate", - 'summary': """ App module created specifically for the Server Framework 101 tutorial. """, - 'description': """ App module created specifically for the Server Framework 101 tutorial. """, - 'author': "Odoo", 'website': "https://www.odoo.com", - - # Categories can be used to filter modules in modules listing - # Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml - # for the full list 'category': 'Tutorials', 'version': '0.1', - - # any module necessary for this one to work correctly 'depends': ['base', 'web'], 'application': True, 'installable': True, 'data': [ + 'data/ir.model.access.csv', 'views/templates.xml', ], - 'assets': { - 'awesome_owl.assets_playground': [ - ('include', 'web._assets_helpers'), - ('include', 'web._assets_backend_helpers'), - 'web/static/src/scss/pre_variables.scss', - 'web/static/lib/bootstrap/scss/_variables.scss', - 'web/static/lib/bootstrap/scss/_maps.scss', - ('include', 'web._assets_bootstrap'), - ('include', 'web._assets_core'), - 'web/static/src/libs/fontawesome/css/font-awesome.css', - 'awesome_owl/static/src/**/*', - ], - }, - 'license': 'AGPL-3' -} +} \ No newline at end of file diff --git a/estate/data/ir.model.access.csv b/estate/data/ir.model.access.csv new file mode 100644 index 00000000000..e57ec5e4eb5 --- /dev/null +++ b/estate/data/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,0,0,0 \ No newline at end of file diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 2ef12abba76..865eace9742 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -3,7 +3,6 @@ class EstatePropertyModel(models.Model): _name = "estate_property" _description = "Real Estate property database" - name = fields.Char(required=True) description = fields.Text() postcode = fields.Char()