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..03799c954ad --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,18 @@ +{ + 'name': 'RealEstate', + 'version': '1.0', + 'category': 'Real Estate/Brokerage', + 'summary': 'A module to manage real estate advertisements and property offers', + 'description': """A simple module to manage real estate ads.List your properties, track details like bedrooms and garden,let buyers make offers, and accept or reject them.""", + 'author': 'Pranjali Sangavekar(prsan)', + 'license': 'LGPL-3', + 'depends': ['base'], + 'application': True, + 'installable': True, + 'data': [ + 'security/security.xml', + 'security/ir.model.access.csv', + 'views/estate_property_views.xml', + 'views/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..dab570e4bbc --- /dev/null +++ b/estate/models/estate_property.py @@ -0,0 +1,32 @@ +from dateutil.relativedelta import relativedelta +from odoo import models, fields + + +class Estate_Property(models.Model): + _name = "estate.property" #table name in DB = estate_property + _description = "Real estate system" + + name = fields.Char(string="Property Name", required=True) + description = fields.Text() + postcode = fields.Char(string="Postal Code") + date_availability = fields.Date(copy=False, default=lambda self: fields.Date.today() + relativedelta(months=3)) + expected_price = fields.Float(string="Expected Price", required=True) + selling_price = fields.Float(readonly=True, copy=False) + bedrooms = fields.Integer(default=2) + living_area = fields.Integer() + facades = fields.Integer() + garage = fields.Boolean() + garden = fields.Boolean() + garden_area = fields.Integer() + garden_orientation = fields.Selection(selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')]) + active = fields.Boolean(default=True) + state = fields.Selection( + selection=[ + ('new', 'New'), + ('offer_received', 'Offer Received'), + ('offer_accepted', 'Offer Accepted'), + ('sold', 'Sold'), + ('cancelled', 'Cancelled'), + ], + required=True, copy=False, default='new' + ) diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 00000000000..1ffcb29c930 --- /dev/null +++ b/estate/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_estate_property_manager,estate.property manager,model_estate_property,estate.estate_group_manager,1,1,1,1 +access_estate_property_user,estate.property agent,model_estate_property,estate.estate_group_user,1,1,0,0 \ No newline at end of file diff --git a/estate/security/security.xml b/estate/security/security.xml new file mode 100644 index 00000000000..79e80966704 --- /dev/null +++ b/estate/security/security.xml @@ -0,0 +1,23 @@ + + + + + Real Estate + + + + + Agent + + + + + Manager + + + + + + + + \ No newline at end of file diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml new file mode 100644 index 00000000000..819397e809a --- /dev/null +++ b/estate/views/estate_menus.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/estate/views/estate_property_views.xml b/estate/views/estate_property_views.xml new file mode 100644 index 00000000000..a91c6da32b0 --- /dev/null +++ b/estate/views/estate_property_views.xml @@ -0,0 +1,61 @@ + + + + estate.property.form + estate.property + +
+ +

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + estate.property.list + estate.property + + + + + + + + + + + + + + Properties + estate.property + list,form + +
\ No newline at end of file