-
Notifications
You must be signed in to change notification settings - Fork 2.8k
19.0 real estate tutorial jakan #1109
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
- Real Estate module created - Basic structure and required fields added - CHAPTER 1, 2, and 3
- Added basic security access for estate records - Fixed missing whitespace and formatting issues - Covers CHAPTER 4
- Added form and list views for estate records - Added menu and action to access the module - Covers CHAPTER 5
- Added list, form, and search views - Added domains and group by options - Covers CHAPTER 6
mash-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 @jakan-odoo,
Good start on the PR,
Please view the comments and apply the needed changes.
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.
For ordering of imports, refer this: https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#imports
| <record id="estate_property_list_view" model="ir.ui.view"> | ||
| <field name="name">estate.property.list</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.
For naming a view: <model_name>_view_<view_type>, where view_type is kanban, form, list, search, …
You can refer this guideline: https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#xml-ids-and-naming
| <record id="estate_property_form_view" model="ir.ui.view"> | ||
| <field name="name">estate.property.form</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.
Do same as suggested above
- Added Many2one relation between models - Improves data linking between records - Covers CHAPTER 7
- Added One2many and Many2many relations between models - Improves linking and management of related records - Covers CHAPTER 7
- Added computed fields for automatic values - Added onchange methods to update fields - Covers CHAPTER 8
- Created Sell, Cancel, Accept, and Refuse buttons - Buttons call related methods on the estate models - Buyer and selling price are set when an offer is accepted - Covers CHAPTER 9
mash-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 going on the task..
Here are some suggestions..
| <field name="bedrooms"/> | ||
| <field name="living_area"/> | ||
| <field name="selling_price"/> | ||
| <filter string="Available Properties" name="available properties" 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.
Can we write this filter in any other way?
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.
Yes ma'am,
We can write filter like this
<filter string="Available Properties" name="available_properties" domain="[('state', 'in', ('new', 'offer_received'))]"/>
| </form> | ||
| </field> | ||
| </record> | ||
| </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.
Leave a line at the end of file
estate/models/estate_property.py
Outdated
| ("north", "North"), | ||
| ("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.
| ("north", "North"), | |
| ("south", "South"), | |
| ("east", "East"), | |
| ("west", "West")]) | |
| ('north', "North"), | |
| ('south', "South"), | |
| ('east', "East"), | |
| ('west', "West")]) |
estate/models/estate_property.py
Outdated
| ('new', 'New'), | ||
| ('offer_received', 'Offer Received'), | ||
| ('offer_accepted', 'Offer Accepted'), | ||
| ('sold', 'Sold'), | ||
| ('cancelled', '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.
| ('new', 'New'), | |
| ('offer_received', 'Offer Received'), | |
| ('offer_accepted', 'Offer Accepted'), | |
| ('sold', 'Sold'), | |
| ('cancelled', 'Cancelled'), | |
| ('new', "New"), | |
| ('offer_received', "Offer Received"), | |
| ('offer_accepted', "Offer Accepted"), | |
| ('sold', "Sold"), | |
| ('cancelled', '"Cancelled"), |
estate/__manifest__.py
Outdated
| @@ -0,0 +1,20 @@ | |||
| { | |||
| 'name': 'Real 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.
| 'name': 'Real Estate', | |
| 'name': "Real Estate", |
estate/__manifest__.py
Outdated
| 'version': '1.0', | ||
| 'category': 'Real Estate', | ||
| 'summary': 'Manage real estate properties', | ||
| 'description': 'This module allows managing 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.
| 'description': 'This module allows managing properties.', | |
| 'description': "This module allows managing properties.", |
estate/models/estate_property.py
Outdated
| from dateutil.relativedelta import relativedelta | ||
| from odoo import fields, models, api |
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.
For ordering of imports, refer this: https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#imports
- Added SQL constraints to ensure data validity - Added Python constraints for business rules - Covers CHAPTER 10
- Added inline views for related records - Applied widgets to improve user interface - Set default ordering using _order - CHAPTER 11

Chapter 4 is completed in this update.
Basic security access rules are added for the Estate module so users can access records correctly. Code style issues like missing white space and formatting problems are also fixed.