-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[IMP] estate: added real estate property model and access rights #1148
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 @aycha-odoo
Good start!
I have reviewed and added some suggestions.
Can you please add a commit message description?
f53a188
No need to do a separate commit for this - 01d9ca3
Thanks
estate/models/estate_property.py
Outdated
| from odoo import fields, models | ||
| 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 read this coding guidelines documentation https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#imports
| [("accepted", "Accepted"), ("rejected", "Rejected")], copy=False | ||
| ) | ||
| partner_id = fields.Many2one("res.partner", required=True, string="Buyer") | ||
|
|
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/security/ir.model.access.csv
Outdated
| access_estate_property,estate.property,model_estate_property,base.group_user,1,1,1,1 | ||
| access_estate_property_type,estate.property.type,model_estate_property_type,base.group_user,1,1,1,1 | ||
| access_estate_property_tag,estate.property.tag,model_estate_property_tag,base.group_user,1,1,1,1 | ||
| access_estate_property_offer,estate.property.offer,model_estate_property_offer,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 EOF.
estate/views/estate_menus.xml
Outdated
| sequence="20" /> | ||
| </menuitem> | ||
| </data> | ||
| </odoo> 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 EOF.
| </field> | ||
| </record> | ||
| </data> | ||
| </odoo> 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 EOF.
| </record> | ||
|
|
||
| </data> | ||
| </odoo> 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 EOF.
| </record> | ||
|
|
||
| </data> | ||
| </odoo> 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 EOF.
| <field name="view_mode">list,form</field> | ||
| </record> | ||
| </data> | ||
| </odoo> 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 EOF.
- Created the basic `estate.property` model. - Added essential fields (name, description, postcode, date_availability, expected_price, selling_price, bedrooms, living_area, facades, garage, garden, garden_area, garden_orientation, active, state). - Added security rules in `ir.model.access.csv` for base user access. - Added init and manifest files for the module structure. Chapter 3-4: New Application & Models
- Fix import ordering (ASCIIbetical) - Rename RealEstateProperty to EstateProperty - Fix XML IDs to include _view_ prefix
-Added estate property list and form view -Menu view is added in seprate xml file Chapter 5:Finally, Some UI To Play With Chapter 6:Basic Views
- Added Property Type model and linked it via Many2one. - Added Buyer (res.partner) and Salesperson (res.users) links. - Added Property Tag model and linked it via Many2many. - Added Property Offer model with One2many link. Chapter 7: Relations Between Models
ad83079 to
dcb437a
Compare
- Add total_area computed field (living_area + garden_area) - Add best_price computed field (max offer price) - Add validity and date_deadline fields on estate.property.offer with compute function - Add garden onchange to set default area and orientation - Apply coding guidelines: fix import ordering, class naming, XML IDs, view names, and remove unnecessary <data> tags ch-8 Computed Fields And Onchanges
- Added 'Sold' and 'Cancel' buttons to the estate.property form header. - Implemented state transition logic with UserError validation (e.g., cannot sell canceled property). - Added 'Accept' and 'Refuse' buttons to the estate.property.offer list view. - Implemented cross-model logic: accepting an offer updates the property's buyer, selling price, and state. - Added validation to ensure only one offer can be accepted per property. Chapter 9: Ready For Some Action
fe45de2 to
48de385
Compare

Initialized the estate module by creating the init.py and manifest.py files.
Added a models directory and implemented the database table logic in estate_property.py.
Defined access rights in ir.model.access.csv, granting users read, write, create, and delete permissions.
Adjusted linting and code structure to improve readability and maintainability.