-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ADD] real_estate: implement core property management module #1100
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
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 update title of this commit message and also add the meesage into commit.
4712d52
Thanks
| @@ -0,0 +1,2 @@ | |||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | |||
| access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 No newline at end of file | |||
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.
Should be one empty line at the EOF.
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.
| from dateutil.relativedelta import relativedelta | ||
| from odoo import fields, models |
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.
Can you please refer to this documentation for import?
https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#imports
|
|
||
| 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?
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 used Char because postcodes in many countries contain letters (e.g., Canada) .An Integer field would not be able to handle this.
| ('south', 'South'), | ||
| ('east', 'East'), | ||
| ('west', 'West'), | ||
| ], |
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.
Wrong indentation.
| </form> | ||
| </field> | ||
| </record> | ||
| <record id="action_estate_property" model="ir.actions.act_window"> |
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 for readability if we leave one empty line above it.
real_estate/views/estate_menus.xml
Outdated
| id="estate_menu_root" | ||
| name="Real Estate"/> | ||
| <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 nameing- https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#xml-ids-and-naming
Implemented Chapters(1 & 2) Architecture Overview and New Application. Changes: - Created module directory `real_estate`. - Defined `__manifest__.py` with metadata (name, depends, license). - Added empty `__init__.py` to initialize the Python package.
Implemented Chapters 3 & 4 (Data Models and Fields and Security files). Changes: - Created the `estate.property` model. - Added basic fields: name, description, postcode, expected_price, selling_price. - Configured default values (e.g., availability date) and field attributes (required, copy=False).
Expose the `estate.property` model in the web interface to allow
basic user interaction.
Changes:
- Create `views/estate_property_views.xml`.
- Define `ir.actions.act_window` to open the property list.
- Define the menu structure:
- Root: "Real Estate"
- Level 1: "Advertisements"
- Action Menu: "Properties"
- Add the new view file to the `data` list in `__manifest__.py`
- Solve the whiteSpace Error in ir.model.access.csv file
- Change in manifest file Auther and version.
Ref: Server Framework 101 - Chapter 5
Added the XML views for the estate property model. - List view: added columns for name, price, bedrooms, and availability. - Form view: organized fields into two columns using groups. - Added a notebook to put the description and other details in tabs.
Added the Search view and refined the existing Form and List views for the estate.property model (Chapter 6). Changes: - Added Search View: Includes standard search fields, 'Available' filter, and 'Postcode' group by. - Form View: Added 'placeholder' text and 'help' tooltips for better UX. - Form View: Implemented 'invisible' logic for garden fields (hides area/orientation if no garden).
Implemented the relational fields between models (Chapter 7) and addressed code review comments. Changes: - Models: Added Many2one (Buyer, Salesperson) and One2many (Offers) fields. - Form View: Integrated the Offers list directly inside the Property notebook. - Menu: Updated menu item naming conventions based on feedback. - Code Style: Improved indentation.
4594df5 to
fe00b97
Compare
Implemented dynamic behavior and workflow logic for properties and offers (Chapters 8 & 9). Changes: - Computed Fields: Added logic for total_area, best_price, and offer validity/deadline. - Onchange: Implemented UI helper to auto-fill garden area and orientation. - Actions: Added buttons to manage Property state (Sold/Cancel) and Offer status (Accept/Refuse). - Logic: Implemented offer acceptance workflow to automatically set the buyer and selling price on the property.
Implemented SQL and Python constraints to ensure data integrity and prevent duplicate or invalid data(chapter 10). Changes: - Enforced unique names for Types/Tags and unique offers per partner. - Added price validation (90% of expected price) and positive value checks.
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
| if record.price <= 0: | ||
| raise ValidationError("Offer Price Must be Positive") | ||
|
|
||
| _check_partner = models.Constraint('UNIQUE(partner_id, property_id)', "User have already made a offer on this property") |
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 coding guidelines.
| for record in self: | ||
| if record.state == 'cancelled': | ||
| raise UserError("Cancelled Properties Can Not 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.
| for record in self: | ||
| if record.state == 'sold': | ||
| raise UserError("Sold Properties can not be cancel") |
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.
| def action_approve(self): | ||
| for record in self: | ||
| if record.state == 'sold': | ||
| raise UserError("Sold properties cannot accept other Offers.") |
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.
Is good to make the error message translatable.

Introduces the Real Estate module to facilitate property sales..
This module allows real estate agencies to: