-
Notifications
You must be signed in to change notification settings - Fork 2.8k
19.0 tutorial dhvag #1110
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?
19.0 tutorial dhvag #1110
Conversation
- Set up the estate module based on the Odoo 19 Server Framework 101 tutorial - Added estate.property model with proper naming conventions - Implemented basic fields as introduced in chapters 1–3 - Kept the code aligned with Odoo ORM standards
- Continued the estate module implementation by completing Chapters 4–6 - Added and configured views, actions, and menus to make the estate.property model fully accessible from the UI - Implemented list and form, views, filter, group-by - Added required defaults and the active field - Verified that all earlier checkpoints (Chapters 1–3) are still satisfied and working as expected - Overall implementation remains consistent with Odoo ORM guidelines and framework best practices
…er 7) - Added relational fields (Many2one, One2many, Many2many) to the estate module - Linked properties with types, offers, tags, buyer, and salesperson - Created required views for managing offers within the property form - Updated access rights for new models
- Fixed the import issue in estate_property_offer file.
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 @dhvag-odoo,
Good work on the new module..
Please check my comments and apply the needed changes
- Applied the changes suggested during code review - Updated XML view structure and corrected attribute order - Cleaned up naming issues in views and filters - Adjusted default values and selection field keys - Removed unnecessary field strings in the model - Added new line in the file ir.model.access.csv
- This chapter introduces computed fields to derive values automatically. - Field dependencies are managed using the @api.depends decorator. - Onchange methods react to user input in real time on forms.
- Added accept and refuse actions for property offers - Handled the case where only one offer should be accepted - Updated property details like selling price and buyer when an offer is accepted - Learn to add python and SQL constraint
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 job on the PR!
Here are some few suggestions..
estate/models/estate_property.py
Outdated
| ('sold', "Sold"), | ||
| ('cancelled', "Cancelled"), | ||
| ], | ||
| default="new", |
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.
| default="new", | |
| default='new', |
estate/models/estate_property.py
Outdated
| seller = fields.Many2one( | ||
| 'res.users', string="Salesman", default=lambda self: self.env.user | ||
| ) | ||
| buyer = fields.Many2one('res.partner', string="Buyer", copy=False) | ||
| tags = fields.Many2many('estate.property.tag') | ||
| offer = fields.One2many('estate.property.offer', 'property_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.
Please follow the naming conventions of these fields.
For example Many2Many should always have _ids suffix.
You can refer from here: https://www.odoo.com/documentation/19.0/developer/tutorials/server_framework_101/07_relations.html?
estate/__manifest__.py
Outdated
| 'description': ''' | ||
| This module provides functionality to manage real estate 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 provides functionality to manage real estate properties. | |
| ''', | |
| 'description': """ | |
| This module provides functionality to manage real estate properties. | |
| """, |
estate/models/estate_property.py
Outdated
| buyer = fields.Many2one('res.partner', string="Buyer", copy=False) | ||
| tags = fields.Many2many('estate.property.tag') | ||
| offer = fields.One2many('estate.property.offer', 'property_id') | ||
| total_area = fields.Float(compute='_compute_total') |
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.
| total_area = fields.Float(compute='_compute_total') | |
| total_area = fields.Float(compute='_compute_total_area') |
Keep the method name in the format: _compute_field_name
| from odoo import api, 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
| <list> | ||
| <field name="name"/> | ||
| <field name="create_date"/> | ||
| <field name="write_date"/> | ||
| </list> |
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.
Fix indentation
| <field name="facades"/> | ||
| <separator/> | ||
| <filter string="New / Offer Received" name="state" | ||
| 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 you write this in a different way?
- Improve the look and behavior of form and list views. - Add status bar, decorations, and widgets for better clarity. - Control button visibility based on record state. - Set default sorting and make views more user-friendly. - Enhance search and display to make records easier to understand.

No description provided.