Skip to content

Commit c704669

Browse files
committed
[IMP] Estate:Fixed Issues and Completed Chapter-4
Fixed warnings and errors raised by the first push. Created security/ir.model.access.csv file in estate for defining access rights. Added the data in csv file and defined the csv file in manifest.
1 parent 88181a3 commit c704669

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

estate/__manifest__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
{'name': 'Real Estate', 'depends': ['base']}
1+
{
2+
'name': 'Real Estate',
3+
'author': 'soham',
4+
'license': 'LGPL-3',
5+
'depends': ['base'],
6+
'data': [
7+
'security/ir.model.access.csv',
8+
],
9+
'installable': True,
10+
'application': True,
11+
}

estate/models/estate_property.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from odoo import fields, models
22

3+
34
class EstateProperty(models.Model):
45
_name = "estate.property"
5-
_description = "Real Estate Property" # Removes the terminal warning
6-
7-
# Required fields (not null in database)
6+
_description = "Real Estate Property"
7+
88
name = fields.Char(required=True)
99
expected_price = fields.Float(required=True)
1010

11-
# Basic fields
11+
1212
description = fields.Text()
1313
postcode = fields.Char()
1414
date_availability = fields.Date()
@@ -20,9 +20,11 @@ class EstateProperty(models.Model):
2020
garden = fields.Boolean()
2121
garden_area = fields.Integer()
2222

23-
# Selection field (Dropdown)
23+
24+
2425
garden_orientation = fields.Selection(
2526
string='Orientation',
2627
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')],
2728
help="The direction the garden faces."
29+
2830
)
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)