Skip to content

Commit 2736ecc

Browse files
committed
[IMP] Estate: Fixed issues and completed Chapter 4
Fixed issues and errors raised by the first push. Defined access rights by creating security/ir.model.access.csv file in estate. Defined the csv file in manifest.
1 parent a6ef0c0 commit 2736ecc

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

estate/__manifest__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
'name': 'Real Estate',
3+
'author': 'Aditi (adpaw)',
4+
'license':'LGPL-3',
35
'depends': [
46
'base',
57
],
8+
'data': [
9+
'security/ir.model.access.csv',
10+
],
11+
'installable': True,
12+
'application': True,
613
}

estate/models/estate_property.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,25 @@
11
from odoo import fields, models
22

3+
34
class EstateProperty(models.Model):
45
_name = "estate.property"
56
_description = "Real Estate Property"
67

78
name = fields.Char(required=True)
89
description = fields.Text()
910
postcode = fields.Char()
10-
date_availability = fields.Date(copy=False, default=lambda self: fields.Datetime.today())
11+
date_availability = fields.Date
1112
expected_price = fields.Float(required=True)
12-
selling_price = fields.Float(readonly=True, copy=False)
13-
bedrooms = fields.Integer(default=2)
13+
selling_price = fields.Float
14+
bedrooms = fields.Integer
1415
living_area = fields.Integer()
1516
facades = fields.Integer()
1617
garage = fields.Boolean()
1718
garden = fields.Boolean()
1819
garden_area = fields.Integer()
1920
garden_orientation = fields.Selection(
2021
string='Orientation',
21-
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')],
22-
help="Direction the garden faces"
23-
)
24-
active = fields.Boolean(default=True)
25-
state = fields.Selection(
2622
selection=[
27-
('new', 'New'),
28-
('offer_received', 'Offer Received'),
29-
('offer_accepted', 'Offer Accepted'),
30-
('sold', 'Sold'),
31-
('canceled', 'Canceled'),
32-
],
33-
string='Status',
34-
required=True,
35-
copy=False,
36-
default='new',
23+
('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')],
24+
help="Direction the garden faces"
3725
)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
2+
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1

0 commit comments

Comments
 (0)