-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[ADD] estate: created a new module #1013
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
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,
Nice work!
I have added some comments please have a look at it.
module name is estate not real_estate.you can addapt it in commit message title.
For commit message you can refer this documentation :- https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html#commit-message-full-description
estate/models/__init__.py
Outdated
| @@ -0,0 +1 @@ | |||
| from . import estate_property 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.
There is a missing "blank" line at the end of the file.
estate/models/estate_property.py
Outdated
| from odoo import models,fields | ||
|
|
||
| class estateproperty(models.Model): |
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.
Leave two lines between import and classes for better readability.
Added a new 'real estate' module, created the database, and defined necessary columns.
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 have added some comments.
estate/models/estate_property.py
Outdated
| from dateutil.relativedelta import relativedelta | ||
|
|
||
| class estateproperty(models.Model): |
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.
Leave two lines between import and classes for better readability.
51d5d60 to
7eb4493
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, nice work!
Please use this documentation:- https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html#commit-message-full-description
do not push commit like "WIP", and make sure that your runbot is green.
estate/models/estate_property.py
Outdated
|
|
||
|
|
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.
One empty line is sufficient.
|
Hello! And please update the PR message. |
53adf3d to
156ec9a
Compare
Set default values for fields, added new field attributes, and created menus for accessing default list and form views in Real Estate module
Created list, form, and search views, and added group by functionality in the Real Estate.
…Real Estate Added Property Type and Tag models, buyer and salesperson fields, and the Property Offer model in the Real Estate module.
…el buttons Added computed fields with inverse functions and onchange methods, along with Sold and Cancel buttons to enhance the Real Estate module functionality.
…Real Estate Added Accept and Refuse buttons along with the supporting functionality to improve workflow in the Real Estate module.
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,
I have added some remarks :)
estate/models/estate_property.py
Outdated
| from odoo import models, fields, api | ||
| from dateutil.relativedelta import relativedelta | ||
| from odoo.exceptions import UserError |
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 odoo import models, fields, api | |
| from dateutil.relativedelta import relativedelta | |
| from odoo.exceptions import UserError | |
| from dateutil.relativedelta import relativedelta | |
| from odoo import models, fields, api | |
| from odoo.exceptions import UserError |
First external libraries and then internal import.
| if record.state == 'sold': | ||
| raise UserError("A sold property cannot be cancelled") | ||
| else: | ||
| self.state = '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.
It will throw an error if multiple records are in self.
| if record.state == 'cancelled': | ||
| raise UserError("A cancelled property cannot be set as sold") | ||
| else: | ||
| self.state = '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.
Same here.
| from odoo import fields, models, 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.
same as the previous file.
156ec9a to
6f8f97b
Compare
…Real Estate Added SQL constraints to ensure positive expected, selling, and offer prices, and unique names for property tags and types. Added a Python constraint to ensure the selling price is not less than 90% of the expected price.

Created and configured the database for the Real Estate module, defining necessary fields such as property type, tags, buyer, salesperson, and offers. Implemented list, form, and search views with groupings, and added computed fields, inverse functions, and onchange functionalities. Included 'Sold' and 'Cancel' buttons with their corresponding functionality, as well as 'Accept' and 'Refuse' buttons with related logic.