diff --git a/estate/__init__.py b/estate/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/estate/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/estate/__manifest__.py b/estate/__manifest__.py new file mode 100644 index 00000000000..ff7482036d0 --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,11 @@ +{ + 'name': 'Estate', + 'depends': ['base'], + 'application': True, + + 'data': [ + 'security/ir.model.access.csv', + 'view/estate_property_views.xml', + 'view/estate_menus.xml' + ], +} diff --git a/estate/models/__init__.py b/estate/models/__init__.py new file mode 100644 index 00000000000..5e1963c9d2f --- /dev/null +++ b/estate/models/__init__.py @@ -0,0 +1 @@ +from . import estate_property diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py new file mode 100644 index 00000000000..6ad7934fa5e --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,50 @@ +from odoo import fields, models +from datetime import timedelta + + +class EstateProperty(models.Model): + _name = "estate.property" + _description = "Estate Property Module" + + name = fields.Char(string="Title", required=True) + description = fields.Text(string="Description") + postcode = fields.Char(string="Postcode") + + expected_price = fields.Float(string="Expected Price", required=True) + selling_price = fields.Float(string="Selling Price", copy=False, readonly=True) + + expected_date = fields.Date( + string="Expected Date", + required=True, + copy=False, + default=(fields.Date.today() + timedelta(days=90)), + ) + + bedroom = fields.Integer(string="Number of Bedroom", default=2) + living_area = fields.Integer(string="Living area (square metter)") + facades = fields.Integer(string="Number of facades") + garage = fields.Boolean(string="Have a garage?") + garden = fields.Boolean(string="Have a garden?") + garden_area = fields.Integer(string="Garden area (square metter)") + garden_orientation = fields.Selection( + string="Garden's orientation", + selection=[ + ("north", "North"), + ("sud", "Sud"), + ("east", " East"), + ("west", "West"), + ], + ) + state = fields.Selection( + string="Estate's state", + selection=[ + ("new", "New"), + ("offer_recieved", "Offer Received"), + ("offer_accepted", " Offer Accepted"), + ("sold", "Sold"), + ("cancelled", "Cancelled"), + ], + default="new", + ) + + active = fields.Boolean(default=False) diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..6923cfaaa0c --- /dev/null +++ b/estate/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_estate_model,access_estate_model,model_estate_property,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/estate/view/estate_menus.xml b/estate/view/estate_menus.xml new file mode 100644 index 00000000000..f42668ae520 --- /dev/null +++ b/estate/view/estate_menus.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/estate/view/estate_property_views.xml b/estate/view/estate_property_views.xml new file mode 100644 index 00000000000..714b0a703b6 --- /dev/null +++ b/estate/view/estate_property_views.xml @@ -0,0 +1,91 @@ + + + + + Estate action + estate.property + list,form + + + + + estate.property.list + estate.property + + + + + + + + + + + + + + + + estate.property.form + estate.property + +
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + estate.property.search + estate.property + + + + + + + + + + + + + + + + + +