-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Real Estate Tutorial (raame) #1248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
Changes from 1 commit
6a48a78
b02fdc0
9d4d467
07e5a3b
7876339
b5fe287
88c7d39
aced897
d1ca42c
ecacc39
3f3834f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| 'name': 'Real Estate', | ||
| 'depends': [ | ||
| 'base' | ||
| ], | ||
| 'data': [ | ||
| 'security/ir.model.access.csv' | ||
| ], | ||
| 'application': True, | ||
| 'license': 'AGPL-3' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import estate_property |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||
| from odoo import fields, models | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| class Property(models.Model): | ||||||||||||||||||||
| _name = "estate.property" | ||||||||||||||||||||
| _description = "Properties of the estate" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| name = fields.Char(required=True) | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good practice to separate attributes from fields 👍 |
||||||||||||||||||||
| description = fields.Text() | ||||||||||||||||||||
| postcode = fields.Char() | ||||||||||||||||||||
| date_availability = fields.Date() | ||||||||||||||||||||
| expected_price = fields.Float(required=True) | ||||||||||||||||||||
| selling_price = fields.Float() | ||||||||||||||||||||
| bedrooms = fields.Integer() | ||||||||||||||||||||
| 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')]) | ||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know we're not paid by line count, but it is sometimes worth using linebreaks for readability
Suggested change
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_property_model,access_property_model,model_estate_property,base.group_user,1,1,1,1 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is good practice to add a trailing empty line to your files |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good practice to end such lines with a
,. This way, if someone later adds a line, they don't have to add the coma so the line stays unchanged, this keeps the git history cleaner!