-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ADD] estate : Add Estate Module #1099
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
Create the Model and the Security Folder CHP 1 : Architecture Overview CHP 2 : A New Application CHP 3 : Models and Basic Fields CHP 4 : Security - A Brief Introduction
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,
Great Work!
can you please adapt your all commit message accroding to guidelines.Also adapt the PR message too.
No need to do separate commit for this changes - 72dac89
Thanks.
estate/__manifest__.py
Outdated
| 'author': 'KRPAT', | ||
| 'website': 'https://www.odoo.com/', | ||
| 'category': 'Tutorials', | ||
| 'version': '19.0.0.0', |
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 you application version. it should be 1.
You can refer this - https://www.odoo.com/documentation/19.0/developer/reference/backend/module.html#manifest
estate/__manifest__.py
Outdated
| @@ -0,0 +1,15 @@ | |||
| { | |||
| 'name': 'RealEstate', | |||
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.
| 'name': 'RealEstate', | |
| 'name': 'Real Estate', |
IMO it is better. What do you think?
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.
Can you please follow these guidelines?
https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#imports
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 apply these changes.
estate/security/ir.model.access.csv
Outdated
| 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.
| <data> | ||
| <record id="estate_property_action" model="ir.actions.act_window"> | ||
| <field name="name">Estate Property Actions</field> | ||
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
| </data> |
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.
Indentation issue.
baabfe5 to
d5e525b
Compare
|
Implemented all the changes as per the instruction . |
2b6ea72 to
a65bc69
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. and update your commit message according to guidelines.
Thanks.
estate/models/estate_property_tag.py
Outdated
| 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.
indentation issues.
| <field name="expected_price" /> | ||
| <field name="living_area" string="Living Area (sqm)" /> | ||
| <field name="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.
unneccary space.
| <field name="facades" /> | ||
|
|
||
| <separator /> | ||
|
|
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.
| <filter name="available" string="Available" domain="['|',('state', '=', 'new'),('state', '=', 'offer_received')]" /> | ||
|
|
||
| <separator /> | ||
|
|
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.
| <separator /> | ||
|
|
||
| <filter name="available" string="Available" domain="['|',('state', '=', 'new'),('state', '=', 'offer_received')]" /> | ||
|
|
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.
| <field name="name">estate.property.search</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="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 space.
02d57c1 to
984bbca
Compare
estate/models/estate_property.py
Outdated
| from odoo import api, 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.
Hello,
I asked you to do this changes multiple time but still you haven't applied these - #1099 (comment)
Can you please tell me the reason behind these?
CHP 6 - Completed Perform the Estate Property List View , Form View ,Group By and Filters [FIX] estate: Changed the estate version
Added Many2one relationship for estate property types and Many2many relationship for estate property tags. Implement list and form views for property types and tags
Implemented the One2many relation Created the Estate Property Offer Model
Perform the Validation and Deadline in Offers Page
984bbca to
ac1b84b
Compare
Perform the Offer Accepting filtering , Handles the Error Also implemented the constraints which showcase the invalid input
8a835cc to
ab085fc
Compare
- Add inline list views for related records to improve readability - Use widgets such as statusbar and many2many_tags with color support - Make offer and tag list views editable - Add list view decorations to visually highlight record states - Improve search behavior with default filters and custom filter domains - Add a stat button on property types to access related offers
ab085fc to
8c6e361
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,
As we discussed previously you have to write about your application not that what you learn in the PR description.
Thanks
| for record in self: | ||
| if float_is_zero(record.selling_price, precision_rounding=0.01): | ||
| continue | ||
|
|
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.
| continue | ||
|
|
||
| min_price = record.expected_price * 0.9 | ||
|
|
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.
| for record in self: | ||
| if not record.offer_ids: | ||
| raise UserError("There are no offers to accept.") | ||
|
|
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.
| raise UserError("There are no offers to accept.") | ||
|
|
||
| best_offer = max(record.offer_ids, key=lambda o: o.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.
| if record.offer_ids.filtered(lambda o: o.status == "accepted"): | ||
| record.selling_price = record.best_price | ||
| record.buyer_id = best_offer.partner_id | ||
|
|
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.
| name = fields.Char(required=True) | ||
| sequence = fields.Integer(default=10) | ||
|
|
||
| _check_unique_type_name = models.Constraint( |
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.
| "property_type_id", | ||
| string="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.
unneccary space.
| offer_ids = fields.One2many( | ||
| "estate.property.offer", "property_type_id", string="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.
unneccary space.
| if record.state == "cancelled": | ||
| raise UserError("A cancelled Property cannot be sold.") | ||
| record.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.
It's good to make the error message translatable.
raise UserError(_("A cancelled Property cannot be sold."))
We can use filtered() here.
if self.filtered(lamda x: x.state=="cancelled")
| for record in self: | ||
| if record.state == "sold": | ||
| raise UserError("A sold Property cannot be cancelled.") | ||
| record.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's good to make the error message translatable.
raise UserError(_("A sold Property cannot be cancelled."))
We can use filtered() here.
if self.filtered(lamda x: x.state=="sold")

Estate Module – Overview
:Users can list their properties and add offers for them.
:Admins can manage offer statuses and property statuses.
:Built custom estate models using Odoo ORM with automatic database management
:Created menus, actions, and list/form views for a user-friendly UI
:Configured access rights and model security
:Added computed fields with dependency tracking
:Implemented model relationships (Many2one, One2many, Many2many)
:Enforced data validation and business rules using constraints