-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ADD] estate: Initialize Real state module #1097
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
- Adds property model with necessary fields. - chapter 2,3
- Remove duplicate garden field in estate_property.py. - Remove unnecessary space. - chapter 2,3
- Remove duplicate garden field in estate_property.py. - Remove unnecessary space. - chapter 2,3
b4ab976 to
316dad9
Compare
-This change introduces the basic UI navigation for the Estate module. -It adds window actions and a menu hierarchy to access property records. -It configures default field behaviors such as read-only fields, defaults, and copy restrictions. - chapter 4,5,6
316dad9 to
2111cd7
Compare
bit-odoo
left a comment
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,
Good Work!
Can you please adapt your PR message and title acrroding to the guidelines.
Thanks
estate/models/estate_property.py
Outdated
| from odoo import models, fields | ||
| from dateutil.relativedelta import relativedelta |
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.
Please follwe this guideliances.
https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#imports
- Add property types and tags models - Link properties with buyers, salespersons, and types - chapter 6,7
-Implemented a One2many field to link estate properties with their related offers. -chapter: 7
ebf724a to
e50a962
Compare
- Implemented computed fields using @api.depends - Added onchange methods to update values dynamically in the UI - Chapter: 8
bit-odoo
left a comment
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,
Good Work!
I have left some comments.
Please update your PR title and description.
Thanks
estate/models/estate_property.py
Outdated
|
|
||
| name = fields.Char(required=True) | ||
| description = fields.Text() | ||
| postcode = fields.Char() |
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.
Why postcode is char() field?
| from odoo import models, fields, api | ||
|
|
||
| from dateutil.relativedelta import relativedelta |
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.
Please follow the import guidelines. Do not do same mistake repeatedly.
| _description = "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 space.
| ("accepted", "Accepted"), | ||
| ("rejected", "Rejected"), | ||
| ], copy=False) | ||
|
|
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 space.
| ], copy=False) | ||
|
|
||
| partner_id = fields.Many2one("res.partner", 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.
Unneccary space.
| string="Property", | ||
| 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.
Unneccary space.
| string="Validity (days)", | ||
| default=7 | ||
| ) | ||
|
|
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 space.
estate/views/estate_menus.xml
Outdated
| parent="estate_menu_root" | ||
| sequence="15"/> | ||
|
|
||
| <menuitem id="estate_menu_properties" |
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.
Please refer to this documentation for XML IDs and naming- https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#xml-ids-and-naming
|
I have made all changes according to the review suggestions. Thank you. |
- Added sold and cancel actions for property offers - Linked accepted offer to property selling price and buyer - Chapter: 9
ed943ba to
c427696
Compare
- Added constraints to enforce unique tags and properties - Fixed style issues and improved validation logic - Chapter: 10
defd568 to
52a77f4
Compare
bit-odoo
left a comment
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,
Can you please update your PR description.
I have made some comments.
Thanks
estate/__manifest__.py
Outdated
| @@ -0,0 +1,17 @@ | |||
| { | |||
| 'name': "Estate", | |||
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.
Please use the same quote throughout the file.
| for record in self: | ||
| if record.property_id.selling_price or record.status == "accepted": | ||
| raise UserError("Offer is already accepted") | ||
| self.status = "accepted" |
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.
Why did you used self?
| if record.property_id.selling_price or record.status == "accepted": | ||
| raise UserError("Offer is already accepted") | ||
| self.status = "accepted" | ||
| rejected_offer = self.search([ |
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.
If we are expecting multiple valus then the variable name should be like rejected_offers.
And again why did you used self inside the loop?
- Added list and form views for property types. - Enabled ordering in property type list. - Hide Accept/Reject buttons once an offer is accepted. - Chapter: 11
|
I have made all changes according to the review suggestions. Thank you. |
- Improved the user interface of the Estate module by refining list and form views. - Added inline list views, statusbar widgets, conditional visibility of fields and buttons, editable list views, color decorations, default search filters, and stat buttons. - Chapter: 11
bit-odoo
left a comment
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,
Can you please improve your PR title.
Thanks
| for record in self: | ||
| if record.state == "sold": | ||
| raise RedirectWarning("A sold property cannot be cancelled", |
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.
We can use filtered here, and it is good to make the error message translatable.
| for record in self: | ||
| if record.state == "cancelled": | ||
| raise UserError("A cancelled property cannot be sold") |
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.
We can use filtered here, and it is good to make the error message translatable.
| if record.property_id.selling_price or record.status == "accepted": | ||
| raise UserError("Offer is already accepted") | ||
| record.status = "accepted" | ||
| rejected_offers = record.search([ |
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 not good to use a search() inside the loop.

Uh oh!
There was an error while loading. Please reload this page.