-
Notifications
You must be signed in to change notification settings - Fork 2.7k
19.0 real estate tutorial haman #1049
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?
Conversation
3a46ead to
949b655
Compare
96dc36b to
2b93d6f
Compare
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.
Hello @haman-odoo
You did a good job 👏
I have added some suggestions. And can you please improve your commit message, and pr message, and title regarding these guidelines - https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html
One more thing, writing a comment is a good idea. But i think it is good only if our code is complex or doing some magic things, etc.
Thanks
estate/__manifest__.py
Outdated
| 'category': 'Sales/Real Estate', | ||
| 'installable': True, | ||
| 'auto_install': False, | ||
| 'description': """Description text""", |
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.
I think we can add description after the name so others can read it easily.
estate/models/__init__.py
Outdated
| @@ -0,0 +1,4 @@ | |||
| from . import estate_property # noqa: F401 | |||
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.
| from . import estate_property # noqa: F401 | |
| from . import estate_property |
estate/models/estate_property.py
Outdated
| from odoo import models, fields | ||
| from dateutil.relativedelta import relativedelta | ||
| from datetime import date |
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.
First, we can import external libraries.
estate/models/estate_property.py
Outdated
| name = fields.Char(string="Property Title", required=True) | ||
| description = fields.Text(string="Description") | ||
| postcode = fields.Char(string="Postcode") | ||
| date_availability = fields.Date( | ||
| string="Available From", | ||
| default=lambda sself: date.today() + relativedelta(months=3), | ||
| copy=False | ||
| ) | ||
| expected_price = fields.Float(string="Expected Price", required=True) | ||
| selling_price = fields.Float( | ||
| string="Selling Price", | ||
| readonly=True, | ||
| copy=False | ||
| ) | ||
|
|
||
| bedrooms = fields.Integer(string="Bedrooms", default=2) | ||
| living_area = fields.Integer(string="Living Area (sqm)") | ||
| facades = fields.Integer(string="Number of Facades") |
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.
No need to declare a string if it is the same as the field name because Odoo can generate a string.
| _description = "Real Estate Property Offer" | ||
|
|
||
| price = fields.Float(string="Price") | ||
|
|
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.
Unneccary diff.
estate/models/estate_property_tag.py
Outdated
| _name = "estate.property.tag" | ||
| _description = "Real Estate Property Tag" | ||
|
|
||
| name = fields.Char(string="Name", required=True) |
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.
Same here, no need to write a string.
estate/views/estate_menus.xml
Outdated
| @@ -0,0 +1,15 @@ | |||
| <!-- /home/odoo/odoo19/tutorials/estate/views/estate_menus.xml --> | |||
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.
unneccary diff.
| @@ -0,0 +1,32 @@ | |||
| <!-- /home/odoo/odoo19/tutorials/estate/views/estate_property_offer_views.xml --> | |||
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.
unneccary diff.
| @@ -0,0 +1,9 @@ | |||
| <!-- /home/odoo/odoo19/tutorials/estate/views/estate_property_type_views.xml --> | |||
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.
unneccary diff.
| @@ -0,0 +1,124 @@ | |||
| <!-- /home/odoo/odoo19/tutorials/estate/views/estate_property_views.xml --> | |||
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.
unneccary diff.
2b93d6f to
8e3df8a
Compare
8e3df8a to
d2aa309
Compare
d2aa309 to
44f5059
Compare

Real Estate Tutorial