diff --git a/estate/__manifest__.py b/estate/__manifest__.py index 9536d6f3fe..6dca474c34 100644 --- a/estate/__manifest__.py +++ b/estate/__manifest__.py @@ -12,6 +12,8 @@ # data files always loaded at installation 'data': [ 'views/estate_property_view.xml', + 'views/estate_property_type_view.xml', + 'views/estate_property_offer_view.xml', 'views/estate_menus.xml', 'security/ir.model.access.csv', ], diff --git a/estate/models/__init__.py b/estate/models/__init__.py index 0c4a347c60..26269d1609 100644 --- a/estate/models/__init__.py +++ b/estate/models/__init__.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from . import estate_property \ No newline at end of file +from . import estate_property +from . import estate_property_type +from . import estate_property_offer \ No newline at end of file diff --git a/estate/models/estate_property.py b/estate/models/estate_property.py index 35fba701bc..36a793a7c7 100644 --- a/estate/models/estate_property.py +++ b/estate/models/estate_property.py @@ -9,7 +9,7 @@ class EstateProperty(models.Model): _description = 'Estate Properties' _order='create_date desc' - name = fields.Char("Name", required=True) + name = fields.Char("Title", required=True) description = fields.Text("Description") postcode = fields.Char("Postcode") date_available = fields.Date("Date Available", copy=False, default=fields.Date.today() + relativedelta(days=90)) @@ -36,4 +36,9 @@ class EstateProperty(models.Model): copy=False, required=True, default="new" - ) \ No newline at end of file + ) + partner_id = fields.Many2one("res.partner", string="Buyer", copy=False) + user_id = fields.Many2one("res.users", string="Salesperson", default=lambda self: self.env.uid) + property_type_id = fields.Many2one("estate.property.type", string="Property Type") + tag_ids=fields.Many2many('estate.property.tag', string="Tags") + offer_ids = fields.One2many('estate.property.offer', 'property_id', string="Offers") \ No newline at end of file diff --git a/estate/models/estate_property_offer.py b/estate/models/estate_property_offer.py new file mode 100644 index 0000000000..9e93537265 --- /dev/null +++ b/estate/models/estate_property_offer.py @@ -0,0 +1,14 @@ +from odoo import models, fields + + +class EstatePropertyOffer(models.Model): + _name = 'estate.property.offer' + _description = 'An offer for a property' + + price = fields.Float("Price") + status = fields.Selection(string="Status", + selection=[("accepted", "Accepted"), + ("refused", "Refused")], + copy=False) + partner_id = fields.Many2one('res.partner', string="Partner", required=True) + property_id = fields.Many2one('estate.property', string="Property", required=True) \ No newline at end of file diff --git a/estate/models/estate_property_type.py b/estate/models/estate_property_type.py new file mode 100644 index 0000000000..5b1e9ac860 --- /dev/null +++ b/estate/models/estate_property_type.py @@ -0,0 +1,15 @@ +from odoo import models, fields + +class EstatePropertyType(models.Model): + _name = 'estate.property.type' + _description = 'Type of a property' + + name = fields.Char(string='Name', required=True) + description = fields.Text(string='Description') + +class EstatePropertyTag(models.Model): + _name = 'estate.property.tag' + _description = 'Type of a property' + + name = fields.Char(string='Name', required=True) + description = fields.Text(string='Description') \ No newline at end of file diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv index 85de405deb..4562365958 100644 --- a/estate/security/ir.model.access.csv +++ b/estate/security/ir.model.access.csv @@ -1,2 +1,5 @@ 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,1,1,1 +estate.access_estate_property_type,access_estate_property,estate.model_estate_property_type,base.group_user,1,1,1,1 +estate.access_estate_property_tag,access_estate_property_tag,estate.model_estate_property_tag,base.group_user,1,1,1,1 +estate.access_estate_property_offer,access_estate_property_offer,estate.model_estate_property_offer,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml index 0fa66c0ece..9308d90c98 100644 --- a/estate/views/estate_menus.xml +++ b/estate/views/estate_menus.xml @@ -2,7 +2,11 @@ - + + + + + \ No newline at end of file diff --git a/estate/views/estate_property_offer_view.xml b/estate/views/estate_property_offer_view.xml new file mode 100644 index 0000000000..9a8a4cfe14 --- /dev/null +++ b/estate/views/estate_property_offer_view.xml @@ -0,0 +1,49 @@ + + + + estate.property.offer.form + estate.property.offer + +
+
+
+ +
+
+
+

+ +

+
+
+ + + + + +
+
+
+
+
+ + + estate.property.offer.view.list + estate.property.offer + + + + + + + + + + + + + + + +
diff --git a/estate/views/estate_property_type_view.xml b/estate/views/estate_property_type_view.xml new file mode 100644 index 0000000000..9e840904db --- /dev/null +++ b/estate/views/estate_property_type_view.xml @@ -0,0 +1,89 @@ + + + + + estate.property.type.form + estate.property.type + +
+
+
+ +
+
+
+

+ +

+
+
+ + + +
+
+
+
+
+ + + estate.property.type.view.list + estate.property.type + + + + + + + + + Property Types + estate.property.type + list,form + + + + + estate.property.tag.form + estate.property.tag + +
+
+
+ +
+
+
+

+ +

+
+
+ + + +
+
+
+
+
+ + + estate.property.tag.view.list + estate.property.tag + + + + + + + + + Property Tag + estate.property.tag + list,form + + +
\ No newline at end of file diff --git a/estate/views/estate_property_view.xml b/estate/views/estate_property_view.xml index 983a50724a..a0f6d6e65d 100644 --- a/estate/views/estate_property_view.xml +++ b/estate/views/estate_property_view.xml @@ -1,10 +1,92 @@ - - estate.property.view.tree + + + estate_property.view.search + estate.property + + + + + + + + + + + + + + + + + + estate.property.form + estate.property + +
+
+
+ +
+
+
+

+ +

+ +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + estate.property.view.list estate.property - + @@ -12,7 +94,7 @@ - +