diff --git a/estate/__init__.py b/estate/__init__.py new file mode 100644 index 00000000000..9a7e03eded3 --- /dev/null +++ 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 new file mode 100644 index 00000000000..a2c2a95a528 --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,20 @@ +{ + '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", + 'category': 'Tutorials', + 'version': '0.1', + 'depends': ['base', 'web'], + 'application': True, + 'installable': True, + 'data': [ + 'data/ir.model.access.csv', + 'views/templates.xml', + ], +} \ 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/__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..865eace9742 --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,27 @@ +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 @@ + + + + +